btrfs-progs: make sure that is_block_device will return only 0/1
authorDavid Sterba <dsterba@suse.com>
Fri, 25 Sep 2015 15:59:43 +0000 (17:59 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:54:26 +0000 (17:54 +0200)
The macro return nonzero, we'll test against 0/1 (or < 0).

Signed-off-by: David Sterba <dsterba@suse.com>
utils.c

diff --git a/utils.c b/utils.c
index 0f8f91d..32e3375 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -959,7 +959,7 @@ int is_block_device(const char *path)
        if (stat(path, &statbuf) < 0)
                return -errno;
 
-       return S_ISBLK(statbuf.st_mode);
+       return !!S_ISBLK(statbuf.st_mode);
 }
 
 /*