summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Walton <calvin.walton@gmail.com>2009-01-21 13:22:49 -0500
committerChris Mason <chris.mason@oracle.com>2009-01-21 13:22:49 -0500
commit901314f07053d1a3504ce20a69eb07f08bba0ac1 (patch)
tree47135c80bd88a00e7b18aa315b12e17205ea32de
parent16b04fb5f55f1141afcec9b1f3929cf5125d9683 (diff)
Fix misleading error message in btrfsctl
This updates Peter Klotz's original patch to use perror instead of fprintf when it fails to open /dev/btrfs-control
-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);