projects
/
project
/
fstools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7bf185
)
libblkid-tiny: fix invalid open syscall return check
author
Daniel Danzberger
<daniel@dd-wrt.com>
Mon, 2 Aug 2021 09:50:00 +0000
(11:50 +0200)
committer
Daniel Golle
<daniel@makrotopia.org>
Tue, 3 Aug 2021 20:38:32 +0000
(21:38 +0100)
open() returns -1 on error, not 0 (stdin).
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
libblkid-tiny/libblkid-tiny.c
patch
|
blob
|
history
diff --git
a/libblkid-tiny/libblkid-tiny.c
b/libblkid-tiny/libblkid-tiny.c
index 18db4efdd8bef7514baeaf43a306d529e5b36722..6e8cd81debd771fb1bca730189efba9b555cac61 100644
(file)
--- a/
libblkid-tiny/libblkid-tiny.c
+++ b/
libblkid-tiny/libblkid-tiny.c
@@
-196,7
+196,7
@@
int probe_block(char *block, struct blkid_struct_probe *pr)
pr->err = -1;
pr->fd = open(block, O_RDONLY);
- if (
!pr->fd
)
+ if (
pr->fd == -1
)
return -1;
for (i = 0; i < ARRAY_SIZE(idinfos); i++) {