]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: add hint about dmesg(8) to error messages
authorKarel Zak <kzak@redhat.com>
Thu, 23 Sep 2021 09:07:55 +0000 (11:07 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Sep 2021 09:07:55 +0000 (11:07 +0200)
Fixes: https://github.com/karelzak/util-linux/pull/1444
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.c

index ceb0bb469a52d91fa9d255071d740c723922ae31..ac7af42cb187f630de00c67a20faf86f24b9ff93 100644 (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) {