summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.c
diff options
context:
space:
mode:
authorKarel Zak2014-04-07 11:53:05 +0200
committerKarel Zak2014-04-07 11:53:05 +0200
commit8ab82185eed76bc20694a197fe10c5f9fb795b80 (patch)
tree8f61d131c6b4aa00929cd99ed35c0ed05ba64587 /sys-utils/mount.c
parentkill: fix bug in --all semantic (diff)
downloadkernel-qcow2-util-linux-8ab82185eed76bc20694a197fe10c5f9fb795b80.tar.gz
kernel-qcow2-util-linux-8ab82185eed76bc20694a197fe10c5f9fb795b80.tar.xz
kernel-qcow2-util-linux-8ab82185eed76bc20694a197fe10c5f9fb795b80.zip
mount: fix --all and nofail return code
Now the "nofail" affects warnings warning messages only. That's wrong and regression (against original non-libmount version). The nofail has to control return code too. Reported-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r--sys-utils/mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index d2d1fdac8..4c5f0e528 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -197,12 +197,14 @@ static int mount_all(struct libmnt_context *cxt)
if (mnt_context_is_verbose(cxt))
printf("%-25s: mount successfully forked\n", tgt);
} else {
- mk_exit_code(cxt, mntrc); /* to print warnings */
-
- if (mnt_context_get_status(cxt)) {
+ if (mk_exit_code(cxt, mntrc) == MOUNT_EX_SUCCESS) {
nsucc++;
- if (mnt_context_is_verbose(cxt))
+ /* Note that MOUNT_EX_SUCCESS return code does
+ * not mean that FS has been really mounted
+ * (e.g. nofail option) */
+ if (mnt_context_get_status(cxt)
+ && mnt_context_is_verbose(cxt))
printf("%-25s: successfully mounted\n", tgt);
} else
nerrs++;