From 54fdddfdc14fa6e9ddf6960cb22d668d83cdf65e Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Fri, 28 Aug 2015 22:11:30 +0800 Subject: btrfs-progs: fix is_block_device() return checks it was highlighted to me is_block_device(), returns 1 if the file is a block device, < 0 in case of an error (eg: file not found) 0 otherwise This patch makes proper return checks at all the places where is_block_device() is used. Thanks to Goffredo. Signed-off-by: Anand Jain Suggested-by: Goffredo Baroncelli Signed-off-by: David Sterba --- mkfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mkfs.c') diff --git a/mkfs.c b/mkfs.c index b8879fcf..a5802f7d 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1494,7 +1494,7 @@ int main(int ac, char **av) while (dev_cnt-- > 0) { file = av[optind++]; - if (is_block_device(file)) + if (is_block_device(file) == 1) if (test_dev_for_mkfs(file, force_overwrite)) exit(1); } @@ -1718,7 +1718,7 @@ int main(int ac, char **av) exit(1); } - if (is_block_device(file)) + if (is_block_device(file) == 1) btrfs_register_one_device(file); if (dev_cnt == 0) @@ -1768,7 +1768,7 @@ int main(int ac, char **av) (unsigned long long)device->devid); } - if (is_block_device(file)) + if (is_block_device(file) == 1) btrfs_register_one_device(file); } -- cgit v1.2.3