diff options
author | Calvin Walton <calvin.walton@gmail.com> | 2009-01-21 13:22:49 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-21 13:22:49 -0500 |
commit | 901314f07053d1a3504ce20a69eb07f08bba0ac1 (patch) | |
tree | 47135c80bd88a00e7b18aa315b12e17205ea32de | |
parent | 16b04fb5f55f1141afcec9b1f3929cf5125d9683 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |