diff options
author | Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> | 2009-01-21 13:59:36 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-21 13:59:36 -0500 |
commit | af250420caf71a4d787891d8ae49f56299a01201 (patch) | |
tree | 0891e574a45e3967544ba0cdf8bc3d592f0c44ea /btrfsck.c | |
parent | ed62c2b0c26381770c33fbd0690d638627de511d (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 'btrfsck.c')
-rw-r--r-- | btrfsck.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2075,6 +2075,9 @@ int main(int ac, char **av) radix_tree_init(); root = open_ctree(av[1], 0, 0); + if (root == NULL) + return 1; + ret = check_extents(root); if (ret) goto out; |