mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-19 19:26:51 +00:00
Ignore the error ENXIO and ENOMEDIUM during a devs scan
Ignore the error ENXIO (device don't exists) and ENOMEDIUM ( No medium found -> like a cd tray empty) in the function btrfs_scan_one_dir. This avoids spurios errors due to an empty CD or a block device node without a device (which is frequent in a static /dev). Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
This commit is contained in:
parent
6cd836d7d9
commit
681813b797
10
utils.c
10
utils.c
@ -1016,8 +1016,14 @@ again:
|
|||||||
}
|
}
|
||||||
fd = open(fullpath, O_RDONLY);
|
fd = open(fullpath, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
fprintf(stderr, "failed to read %s: %s\n", fullpath,
|
/* ignore the following errors:
|
||||||
strerror(errno));
|
ENXIO (device don't exists)
|
||||||
|
ENOMEDIUM (No medium found ->
|
||||||
|
like a cd tray empty)
|
||||||
|
*/
|
||||||
|
if(errno != ENXIO && errno != ENOMEDIUM)
|
||||||
|
fprintf(stderr, "failed to read %s: %s\n",
|
||||||
|
fullpath, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
|
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
|
||||||
|
Loading…
Reference in New Issue
Block a user