mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-09 06:59:30 +00:00
btrfs-progs: scan: pass blkid_get_cache error code
blkid_get_cache() returns error code which is -errno. So we can use them directly. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f54d891ac8
commit
f2d5990d31
8
utils.c
8
utils.c
@ -1994,9 +1994,11 @@ int btrfs_scan_devices(void)
|
|||||||
if (btrfs_scan_done)
|
if (btrfs_scan_done)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (blkid_get_cache(&cache, NULL) < 0) {
|
ret = blkid_get_cache(&cache, NULL);
|
||||||
error("blkid cache get failed");
|
if (ret < 0) {
|
||||||
return 1;
|
errno = -ret;
|
||||||
|
error("blkid cache get failed: %m");
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
blkid_probe_all(cache);
|
blkid_probe_all(cache);
|
||||||
iter = blkid_dev_iterate_begin(cache);
|
iter = blkid_dev_iterate_begin(cache);
|
||||||
|
Loading…
Reference in New Issue
Block a user