[PATCH 7/7] mount: try to tell what mount was doing when it failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 sys-utils/mount.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 9c4729e..64ec0a7 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;
 
-- 
2.8.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux