From 92d62e0ebadb2bafa11948045ed07ea0c30d9686 Mon Sep 17 00:00:00 2001 From: mux Date: Thu, 23 May 2002 23:08:27 +0000 Subject: Make mount_nullfs(8) use nmount(2) rather than mount(2) now that nullfs has been converted to nmount. --- sbin/mount_nullfs/mount_nullfs.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'sbin/mount_nullfs') diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index 31f2d96..5af8daa 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -50,7 +50,6 @@ static const char rcsid[] = #include #include -#include #include #include @@ -74,7 +73,7 @@ main(argc, argv) int argc; char *argv[]; { - struct null_args args; + struct iovec iov[6]; int ch, mntflags; char source[MAXPATHLEN]; char target[MAXPATHLEN]; @@ -105,8 +104,6 @@ main(argc, argv) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", argv[0], target, argv[1]); - args.target = target; - error = getvfsbyname("nullfs", &vfc); if (error && vfsisloadable("nullfs")) { if(vfsload("nullfs")) @@ -117,7 +114,20 @@ main(argc, argv) if (error) errx(EX_OSERR, "null/loopback filesystem is not available"); - if (mount(vfc.vfc_name, source, mntflags, &args)) + iov[0].iov_base = "fstype"; + iov[0].iov_len = sizeof("fstype"); + iov[1].iov_base = vfc.vfc_name; + iov[1].iov_len = strlen(vfc.vfc_name) + 1; + iov[2].iov_base = "fspath"; + iov[2].iov_len = sizeof("fspath"); + iov[3].iov_base = source; + iov[3].iov_len = strlen(source) + 1; + iov[4].iov_base = "target"; + iov[4].iov_len = sizeof("target"); + iov[5].iov_base = target; + iov[5].iov_len = strlen(target) + 1; + + if (nmount(iov, 6, mntflags)) err(1, NULL); exit(0); } -- cgit v1.1