diff options
author | Karel Zak <kzak@redhat.com> | 2007-03-19 20:33:17 +0100 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-03-20 09:31:33 +1100 |
commit | f12ed63e95dec929d6893b16983233d2940a889c (patch) | |
tree | 7ce92983c03d43f7be69afff36ee3104892d64b8 /utils/mount/mount.c | |
parent | be73b5afb50ecfda9d85aaac247792b1b7d7dc62 (diff) | |
download | nfs-utils-f12ed63e95dec929d6893b16983233d2940a889c.tar.gz nfs-utils-f12ed63e95dec929d6893b16983233d2940a889c.tar.xz nfs-utils-f12ed63e95dec929d6893b16983233d2940a889c.zip |
Correctly handle -f (fake) mount option.
The fake option has to write to mtab like a normal mount. Read mount(8) man
page for more details. It's very important for system init scripts that use
"-f" as a way how write info about mount points to /etc/mtab.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/mount/mount.c')
-rw-r--r-- | utils/mount/mount.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c index 45428b0..55d60aa 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -443,18 +443,18 @@ int main(int argc, char *argv[]) start_statd(); } - if (fake) - return 0; if (mnt_err) exit(EX_FAIL); - mnt_err = do_mount_syscall(spec, mount_point, - nfs_mount_vers == 4 ? "nfs4" : "nfs", - flags, mount_opts); - - if (mnt_err) { - mount_error(mount_point); - exit(EX_FAIL); + if (!fake) { + mnt_err = do_mount_syscall(spec, mount_point, + nfs_mount_vers == 4 ? "nfs4" : "nfs", + flags, mount_opts); + + if (mnt_err) { + mount_error(mount_point); + exit(EX_FAIL); + } } if (!nomtab) |