btrfs-progs: fix is_block_device() return checks
authorAnand Jain <anand.jain@oracle.com>
Fri, 28 Aug 2015 14:11:30 +0000 (22:11 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:54:29 +0000 (17:54 +0200)
commit54fdddfdc14fa6e9ddf6960cb22d668d83cdf65e
treed34a2b250561bb48239b54debce8717efe89ac9a
parent5e561cef1d51e6fc6b52460f70b9bca5d4b3ed03
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 <anand.jain@oracle.com>
Suggested-by: Goffredo Baroncelli <kreijack@inwind.it>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-device.c
mkfs.c
utils.c