diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
commit | 1c0f77f024b01c2df41c395b7e5afd760d0a9062 (patch) | |
tree | 8250189179b31e1866ff4aede6002aa33af8d808 /sbin/mount_union | |
parent | f461294e0761e04bbc572e265770de9410b31c41 (diff) | |
download | FreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.zip FreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.tar.gz |
Merge from Lite2 (use new getvfsbyname() and mount(2) interface)
Diffstat (limited to 'sbin/mount_union')
-rw-r--r-- | sbin/mount_union/Makefile | 1 | ||||
-rw-r--r-- | sbin/mount_union/mount_union.c | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sbin/mount_union/Makefile b/sbin/mount_union/Makefile index e213137..6ac36c9 100644 --- a/sbin/mount_union/Makefile +++ b/sbin/mount_union/Makefile @@ -5,6 +5,7 @@ SRCS= mount_union.c getmntopts.c MAN8= mount_union.8 MOUNT= ${.CURDIR}/../mount +CFLAGS+= -D_NEW_VFSCONF CFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT} .PATH: ${MOUNT} diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index 54c4647..cb5e406 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -74,7 +74,8 @@ main(argc, argv) struct union_args args; int ch, mntflags; char target[MAXPATHLEN]; - struct vfsconf *vfc; + struct vfsconf vfc; + int error; mntflags = 0; args.mntflags = UNMNT_ABOVE; @@ -111,17 +112,17 @@ main(argc, argv) args.target = target; - vfc = getvfsbyname("union"); - if(!vfc && vfsisloadable("union")) { - if(vfsload("union")) - err(1, "vfsload(union)"); + error = getvfsbyname("union", &vfc); + if (error && vfsisloadable("union")) { + if (vfsload("union")) + err(EX_OSERR, "vfsload(union)"); endvfsent(); /* flush cache */ - vfc = getvfsbyname("union"); + error = getvfsbyname("union", &vfc); } - if (!vfc) + if (error) errx(EX_OSERR, "union filesystem is not available"); - if (mount(vfc->vfc_index, argv[1], mntflags, &args)) + if (mount(vfc.vfc_name, argv[1], mntflags, &args)) err(EX_OSERR, target); exit(0); } |