summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-02-04 10:57:57 -0500
committerDavid Sterba <dsterba@suse.cz>2013-02-06 23:09:02 +0100
commita8cb2d03dde2de7934a02b4ef8a8be7f56c01720 (patch)
treebb925e2783e79416553b878e2309aeee1e0135d5
parent82ac34581e8fae6ef3f84758361c75f5b30c576d (diff)
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>
-rw-r--r--utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index f9ee8121..01780ff6 100644
--- a/utils.c
+++ b/utils.c
@@ -1229,7 +1229,8 @@ scan_again:
fd = open(fullpath, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "failed to read %s\n", fullpath);
+ fprintf(stderr, "failed to open %s: %s\n",
+ fullpath, strerror(errno));
continue;
}
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,