Skip to contentSkip to conversation

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

PATCH New Gene Czarcinski 2 participants 3 messages Feb 4, 2013 – Feb 6, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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

I believe that this patch may have been lost in the noise and I felt it made a very small but meaningful change so I shuffled some test around and made sure it applied to integration-20120201

This patch simply prints more informative message when we fail to open a device.

Eric Sandeen (1):
Btrfs-progs print more informative error when we fail to open a device

 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.1
#1 lore raw

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

From: Eric Sandeen <[email protected]>

print more informative error when we fail to open a device

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

---
 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
utils.c +2 -1
index d92f317..b560a49 100644
@@ -1212,7 +1212,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,
Signature · 1 line
1.8.1
#2 lore raw
Quoted 5 lines · Gene Czarcinski

From: Eric Sandeen <[email protected]>

print more informative error when we fail to open a device

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

Thanks, added to next integration queue.