* update for WARNS=1

* getopt returns -1 not EOF
* fix .Nm usage
This commit is contained in:
lukem 1997-09-15 05:35:37 +00:00
parent 3cb80143db
commit 0965d12ed9
2 changed files with 12 additions and 11 deletions

View File

@ -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.

View File

@ -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 <sys/cdefs.h>
#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);
}