Skip to content

Commit

Permalink
findmnt: add reason to "cannot detect on-disk filesystem type" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
karelzak committed Jan 21, 2022
1 parent 0b2cd9d commit e209dd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions misc-utils/findmnt-verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,17 @@ static int verify_fstype(struct verify_context *vfy)
if (!isswap && !isauto && !none && !is_supported_filesystem(vfy, type))
verify_warn(vfy, _("%s seems unsupported by the current kernel"), type);
}

errno = 0;
realtype = mnt_get_fstype(src, &ambi, cache);

if (!realtype) {
const char *reson = errno ? strerror(errno) : _("reason uknown");

if (isauto)
verify_err(vfy, _("cannot detect on-disk filesystem type"));
verify_err(vfy, _("cannot detect on-disk filesystem type (%s)"), reson);
else
verify_warn(vfy, _("cannot detect on-disk filesystem type"));
verify_warn(vfy, _("cannot detect on-disk filesystem type (%s)"), reson);
goto done;
}

Expand Down

0 comments on commit e209dd3

Please sign in to comment.