projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2aaaaf
)
getgroups(): clarify code
author
Nikolaus Rath
<Nikolaus@rath.org>
Mon, 5 Jun 2017 11:27:31 +0000
(07:27 -0400)
committer
Nikolaus Rath
<Nikolaus@rath.org>
Mon, 5 Jun 2017 11:27:31 +0000
(07:27 -0400)
read() return value should always be positive or -1. However,
since we cast to unsigned a little later, it's clearer
to check for non-negativity.
lib/fuse_lowlevel.c
patch
|
blob
|
history
diff --git
a/lib/fuse_lowlevel.c
b/lib/fuse_lowlevel.c
index c3724a639b995e9e92ae4669b3b0726f7c65130b..c1c573fa2f83a6f22a8dc371515d0df5a37493ca 100644
(file)
--- a/
lib/fuse_lowlevel.c
+++ b/
lib/fuse_lowlevel.c
@@
-2935,7
+2935,7
@@
retry:
ret = read(fd, buf, bufsize);
close(fd);
- if (ret
== -1
) {
+ if (ret
< 0
) {
ret = -EIO;
goto out_free;
}