aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_unionfs/mount_unionfs.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-03-11 12:40:45 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-03-11 12:40:45 +0000
commit4a4c52857ed2d7183846d70bee04c6a59e60397f (patch)
tree8acef5f2f1360220e97dd7a0c6c3b9bfc8e51f85 /sbin/mount_unionfs/mount_unionfs.c
parentb94d6bf4d7f27e96eea604253b86ad299a54fa12 (diff)
downloadsrc-4a4c52857ed2d7183846d70bee04c6a59e60397f.tar.gz
src-4a4c52857ed2d7183846d70bee04c6a59e60397f.zip
Merge from Lite2 (use new getvfsbyname() and mount(2) interface)
Notes
Notes: svn path=/head/; revision=23680
Diffstat (limited to 'sbin/mount_unionfs/mount_unionfs.c')
-rw-r--r--sbin/mount_unionfs/mount_unionfs.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sbin/mount_unionfs/mount_unionfs.c b/sbin/mount_unionfs/mount_unionfs.c
index 54c464714b05..cb5e406b6adb 100644
--- a/sbin/mount_unionfs/mount_unionfs.c
+++ b/sbin/mount_unionfs/mount_unionfs.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);
}