From 0965d12ed9526b1006a9b5dd1efba635e4c93fa4 Mon Sep 17 00:00:00 2001 From: lukem Date: Mon, 15 Sep 1997 05:35:37 +0000 Subject: [PATCH] * update for WARNS=1 * getopt returns -1 not EOF * fix .Nm usage --- sbin/mount_null/mount_null.8 | 8 ++++---- sbin/mount_null/mount_null.c | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sbin/mount_null/mount_null.8 b/sbin/mount_null/mount_null.8 index 6490b1d1d0d9..892a88725666 100644 --- a/sbin/mount_null/mount_null.8 +++ b/sbin/mount_null/mount_null.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_null.8,v 1.4 1996/04/10 20:57:19 thorpej Exp $ +.\" $NetBSD: mount_null.8,v 1.5 1997/09/15 05:35:37 lukem Exp $ .\" .\" Copyright (c) 1992, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -43,13 +43,13 @@ .Nm mount_null .Nd demonstrate the use of a null file system layer .Sh SYNOPSIS -.Nm mount_null +.Nm .Op Fl o Ar options .Ar target .Ar mount-point .Sh DESCRIPTION The -.Nm mount_null +.Nm command creates a null layer, duplicating a sub-tree of the file system name space under another part of the global file system namespace. @@ -208,5 +208,5 @@ UCLA Technical Report CSD-910056, .Em "Stackable Layers: an Architecture for File System Development" . .Sh HISTORY The -.Nm mount_null +.Nm utility first appeared in 4.4BSD. diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index 76f77190e9cf..869ba8503422 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_null.c,v 1.3 1996/04/13 01:31:49 jtc Exp $ */ +/* $NetBSD: mount_null.c,v 1.4 1997/09/15 05:35:38 lukem Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -36,17 +36,17 @@ * SUCH DAMAGE. */ +#include #ifndef lint -char copyright[] = -"@(#) Copyright (c) 1992, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; +__COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"); #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$NetBSD: mount_null.c,v 1.3 1996/04/13 01:31:49 jtc Exp $"; +__RCSID("$NetBSD: mount_null.c,v 1.4 1997/09/15 05:35:38 lukem Exp $"); #endif #endif /* not lint */ @@ -67,6 +67,7 @@ const struct mntopt mopts[] = { { NULL } }; +int main __P((int, char *[])); int subdir __P((const char *, const char *)); void usage __P((void)); @@ -80,7 +81,7 @@ main(argc, argv) char target[MAXPATHLEN]; mntflags = 0; - while ((ch = getopt(argc, argv, "o:")) != EOF) + while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { case 'o': getmntopts(optarg, mopts, &mntflags); @@ -105,7 +106,7 @@ main(argc, argv) args.target = target; if (mount(MOUNT_NULL, argv[1], mntflags, &args)) - err(1, NULL); + err(1, "%s", ""); exit(0); }