* update for WARNS=1
* getopt returns -1 not EOF * fix .Nm usage
This commit is contained in:
parent
3cb80143db
commit
0965d12ed9
@ -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
|
.\" Copyright (c) 1992, 1993, 1994
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -43,13 +43,13 @@
|
|||||||
.Nm mount_null
|
.Nm mount_null
|
||||||
.Nd demonstrate the use of a null file system layer
|
.Nd demonstrate the use of a null file system layer
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm mount_null
|
.Nm
|
||||||
.Op Fl o Ar options
|
.Op Fl o Ar options
|
||||||
.Ar target
|
.Ar target
|
||||||
.Ar mount-point
|
.Ar mount-point
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm mount_null
|
.Nm
|
||||||
command creates a
|
command creates a
|
||||||
null layer, duplicating a sub-tree of the file system
|
null layer, duplicating a sub-tree of the file system
|
||||||
name space under another part of the global file system namespace.
|
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" .
|
.Em "Stackable Layers: an Architecture for File System Development" .
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
The
|
The
|
||||||
.Nm mount_null
|
.Nm
|
||||||
utility first appeared in 4.4BSD.
|
utility first appeared in 4.4BSD.
|
||||||
|
@ -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
|
* Copyright (c) 1992, 1993, 1994
|
||||||
@ -36,17 +36,17 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
char copyright[] =
|
__COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
The Regents of the University of California. All rights reserved.\n");
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94";
|
static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94";
|
||||||
#else
|
#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
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -67,6 +67,7 @@ const struct mntopt mopts[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int main __P((int, char *[]));
|
||||||
int subdir __P((const char *, const char *));
|
int subdir __P((const char *, const char *));
|
||||||
void usage __P((void));
|
void usage __P((void));
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ main(argc, argv)
|
|||||||
char target[MAXPATHLEN];
|
char target[MAXPATHLEN];
|
||||||
|
|
||||||
mntflags = 0;
|
mntflags = 0;
|
||||||
while ((ch = getopt(argc, argv, "o:")) != EOF)
|
while ((ch = getopt(argc, argv, "o:")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'o':
|
case 'o':
|
||||||
getmntopts(optarg, mopts, &mntflags);
|
getmntopts(optarg, mopts, &mntflags);
|
||||||
@ -105,7 +106,7 @@ main(argc, argv)
|
|||||||
args.target = target;
|
args.target = target;
|
||||||
|
|
||||||
if (mount(MOUNT_NULL, argv[1], mntflags, &args))
|
if (mount(MOUNT_NULL, argv[1], mntflags, &args))
|
||||||
err(1, NULL);
|
err(1, "%s", "");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user