diff options
Diffstat (limited to 'btrfs-find-root.c')
-rw-r--r-- | btrfs-find-root.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/btrfs-find-root.c b/btrfs-find-root.c index c6e6b82f..cdbcca6d 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -278,7 +278,6 @@ static int find_root(struct btrfs_root *root) int main(int argc, char **argv) { struct btrfs_root *root; - int dev_fd; int opt; int ret; @@ -306,15 +305,7 @@ int main(int argc, char **argv) exit(1); } - dev_fd = open(argv[optind], O_RDONLY); - if (dev_fd < 0) { - fprintf(stderr, "Failed to open device %s\n", argv[optind]); - exit(1); - } - - root = open_ctree_broken(dev_fd, argv[optind]); - close(dev_fd); - + root = open_ctree(argv[optind], 0, OPEN_CTREE_CHUNK_ROOT_ONLY); if (!root) { fprintf(stderr, "Open ctree failed\n"); exit(1); |