From f12ed63e95dec929d6893b16983233d2940a889c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 19 Mar 2007 20:33:17 +0100 Subject: [PATCH] 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 Signed-off-by: Neil Brown --- utils/mount/mount.c | 18 +++++++++--------- 1 file 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) -- 2.39.2