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
This commit is contained in:
Calvin Walton 2009-01-21 13:22:49 -05:00 committed by Chris Mason
parent 16b04fb5f5
commit 901314f070

View file

@ -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);