mount: add hint about dmesg(8) to error messages

Fixes: https://github.com/karelzak/util-linux/pull/1444
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-09-23 11:07:55 +02:00
parent 256e524f57
commit 79534c0d7e
1 changed files with 4 additions and 0 deletions

View File

@ -354,6 +354,10 @@ static int mk_exit_code(struct libmnt_context *cxt, int rc)
if (!spec)
spec = "???";
warnx("%s: %s.", spec, buf);
if (mnt_context_syscall_called(cxt) &&
mnt_context_get_syscall_errno(cxt) != 0)
fprintf(stderr, _(" dmesg(1) may have more information after failed mount system call.\n"));
}
if (rc == MNT_EX_SUCCESS && mnt_context_get_status(cxt) == 1) {