path: root/disk-io.c
diff options
authorThadeu Lima de Souza Cascardo <>2009-01-21 13:59:36 -0500
committerChris Mason <>2009-01-21 13:59:36 -0500
commitaf250420caf71a4d787891d8ae49f56299a01201 (patch)
tree0891e574a45e3967544ba0cdf8bc3d592f0c44ea /disk-io.c
parented62c2b0c26381770c33fbd0690d638627de511d (diff)
btrfsck: Exit and print error message when not able to open a device
If btrfsck is not able to open a device, it segfaults. This fixes it and prints an error message too.
Diffstat (limited to 'disk-io.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/disk-io.c b/disk-io.c
index c15cf53e..e49c220d 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -530,6 +530,7 @@ struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes)
fp = open(filename, flags, 0600);
if (fp < 0) {
+ fprintf (stderr, "Coult not open %s\n", filename);
return NULL;
root = open_ctree_fd(fp, filename, sb_bytenr, writes);