From a8cb2d03dde2de7934a02b4ef8a8be7f56c01720 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 4 Feb 2013 10:57:57 -0500 Subject: 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 Signed-off-by: Gene Czarcinski --- utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3