shared/dissect-image: fix return value for probe_filesystem()

blkid_new_probe_from_filename() sets errno, for example EPERM.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-11-24 21:31:47 +01:00
parent c34b75a124
commit 995fa2e5e1
1 changed files with 2 additions and 1 deletions

View File

@ -57,9 +57,10 @@ int probe_filesystem(const char *node, char **ret_fstype) {
const char *fstype;
int r;
errno = 0;
b = blkid_new_probe_from_filename(node);
if (!b)
return -ENOMEM;
return -errno ?: -ENOMEM;
blkid_probe_enable_superblocks(b, 1);
blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);