summaryrefslogtreecommitdiffstats
path: root/sys-utils/mount.c
diff options
context:
space:
mode:
authorSami Kerola2016-04-16 20:05:58 +0200
committerSami Kerola2016-04-17 00:09:27 +0200
commit592fe0175f25a5d50d14de4eecdb7f22be4bdb39 (patch)
tree9c8d451a938ec0f1caa9a9e35d642181eff52eeb /sys-utils/mount.c
parentdmesg: --notime should not suppress --show-delta (diff)
downloadkernel-qcow2-util-linux-592fe0175f25a5d50d14de4eecdb7f22be4bdb39.tar.gz
kernel-qcow2-util-linux-592fe0175f25a5d50d14de4eecdb7f22be4bdb39.tar.xz
kernel-qcow2-util-linux-592fe0175f25a5d50d14de4eecdb7f22be4bdb39.zip
mount: try to tell what mount was doing when it failed
Earlier output did not give enough information to system admin to fix an issue in /etc/fstab effectively. $ sudo mount -a mount: mount(2) failed: No such file or directory Addresses: https://bugs.launchpad.net/bugs/1557145 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r--sys-utils/mount.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 9c4729ef8..64ec0a779 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -520,7 +520,12 @@ try_readonly:
warnx(_("special device %s does not exist"), src);
} else {
errno = syserr;
- warn(_("mount(2) failed")); /* print errno */
+ if (tgt)
+ warn("%s: %s", _("mount(2) failed"), tgt);
+ else if (src)
+ warn("%s: %s", _("mount(2) failed"), src);
+ else
+ warn(_("mount(2) failed"));
}
break;
@@ -535,7 +540,7 @@ try_readonly:
"(a path prefix is not a directory)"), src);
} else {
errno = syserr;
- warn(_("mount(2) failed")); /* print errno */
+ warn("%s: %s", _("mount(2) failed"), tgt);
}
break;