diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
commit | 4a4c52857ed2d7183846d70bee04c6a59e60397f (patch) | |
tree | 8acef5f2f1360220e97dd7a0c6c3b9bfc8e51f85 /sbin/mount_nullfs/mount_nullfs.c | |
parent | b94d6bf4d7f27e96eea604253b86ad299a54fa12 (diff) |
Merge from Lite2 (use new getvfsbyname() and mount(2) interface)
Notes
Notes:
svn path=/head/; revision=23680
Diffstat (limited to 'sbin/mount_nullfs/mount_nullfs.c')
-rw-r--r-- | sbin/mount_nullfs/mount_nullfs.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index 2d654c67240f..9269a718e0e8 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -42,10 +42,10 @@ char copyright[] = #ifndef lint /* -static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94"; +static char sccsid[] = "@(#)mount_null.c 8.6 (Berkeley) 4/26/95"; */ static const char rcsid[] = - "$Id$"; + "$Id: mount_null.c,v 1.7 1997/02/22 14:32:51 peter Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -77,7 +77,8 @@ main(argc, argv) struct null_args args; int ch, mntflags; char target[MAXPATHLEN]; - struct vfsconf *vfc; + struct vfsconf vfc; + int error; mntflags = 0; while ((ch = getopt(argc, argv, "o:")) != EOF) @@ -104,18 +105,18 @@ main(argc, argv) args.target = target; - vfc = getvfsbyname("null"); - if(!vfc && vfsisloadable("null")) { + error = getvfsbyname("null", &vfc); + if (error && vfsisloadable("null")) { if(vfsload("null")) err(EX_OSERR, "vfsload(null)"); - endvfsent(); /* flush cache */ - vfc = getvfsbyname("null"); + endvfsent(); + error = getvfsbyname("null", &vfc); } - if (!vfc) - errx(EX_OSERR, "null filesystem is not available"); + if (error) + errx(EX_OSERR, "null/loopback filesystem is not available"); - if (mount(vfc->vfc_index, argv[1], mntflags, &args)) - err(EX_OSERR, target); + if (mount(vfc.vfc_name, argv[1], mntflags, &args)) + err(1, NULL); exit(0); } |