summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--btrfsctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/btrfsctl.c b/btrfsctl.c
index e0497992..df1a1657 100644
--- a/btrfsctl.c
+++ b/btrfsctl.c
@@ -189,6 +189,10 @@ int main(int ac, char **av)
if (command == BTRFS_IOC_SCAN_DEV) {
fd = open("/dev/btrfs-control", O_RDWR);
+ if (fd < 0) {
+ perror("failed to open /dev/btrfs-control");
+ exit(1);
+ }
name = fname;
} else {
fd = open_file_or_dir(fname);