shared/dissect-image: fix return value for probe_filesystem()
blkid_new_probe_from_filename() sets errno, for example EPERM.
This commit is contained in:
parent
c34b75a124
commit
995fa2e5e1
|
@ -57,9 +57,10 @@ int probe_filesystem(const char *node, char **ret_fstype) {
|
||||||
const char *fstype;
|
const char *fstype;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
b = blkid_new_probe_from_filename(node);
|
b = blkid_new_probe_from_filename(node);
|
||||||
if (!b)
|
if (!b)
|
||||||
return -ENOMEM;
|
return -errno ?: -ENOMEM;
|
||||||
|
|
||||||
blkid_probe_enable_superblocks(b, 1);
|
blkid_probe_enable_superblocks(b, 1);
|
||||||
blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);
|
blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);
|
||||||
|
|
Loading…
Reference in a new issue