projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ece0e1e
)
btrfs-progs: make sure that is_block_device will return only 0/1
author
David Sterba
<dsterba@suse.com>
Fri, 25 Sep 2015 15:59:43 +0000
(17:59 +0200)
committer
David 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
patch
|
blob
|
history
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);
}
/*