From bf081a907c34bce3fa75f4d84c465a3fbe103911 Mon Sep 17 00:00:00 2001 From: mux Date: Thu, 2 May 2002 20:52:04 +0000 Subject: [PATCH] Swap the order of mount and nmount calls. We now call nmount first, since all the consumers of mount_std in the tree have been converted to nmount. --- sbin/mount_std/mount_std.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index 225c19734866..3c182f714597 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -124,23 +124,23 @@ main(argc, argv) /* resolve the mountpoint with realpath(3) */ (void)checkpath(argv[1], mntpath); - error = mount(vfc.vfc_name, mntpath, mntflags, NULL); + 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("fstype"); + iov[3].iov_base = mntpath; + iov[3].iov_len = strlen(mntpath) + 1; + error = nmount(iov, 4, mntflags); /* - * Try with the new mount syscall in the case - * this filesystem has been converted. + * Try with the old mount syscall in the case + * this filesystem has not been converted yet, + * or the user didn't recompile his kernel. */ - if (error && errno == EOPNOTSUPP) { - 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("fstype"); - iov[3].iov_base = mntpath; - iov[3].iov_len = strlen(mntpath) + 1; - error = nmount(iov, 4, mntflags); - } + if (error && errno == EOPNOTSUPP) + error = mount(vfc.vfc_name, mntpath, mntflags, NULL); if (error) err(EX_OSERR, NULL);