Btrfs-progs print more informative error when we fail to open a device

print more informative error when we fail to open a device

If open() fails, we should let the user know why it failed.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Gene Czarcinski <gene@czarc.net>
This commit is contained in:
Eric Sandeen 2013-02-04 10:57:57 -05:00 committed by David Sterba
parent 82ac34581e
commit a8cb2d03dd
1 changed files with 2 additions and 1 deletions

View File

@ -1229,7 +1229,8 @@ scan_again:
fd = open(fullpath, O_RDONLY); fd = open(fullpath, O_RDONLY);
if (fd < 0) { if (fd < 0) {
fprintf(stderr, "failed to read %s\n", fullpath); fprintf(stderr, "failed to open %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,