aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-06-05 07:27:31 -0400
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-06-05 07:27:31 -0400
commit60a0f6b00ea069e1eb0d9adb1c0234c9d2dd63f1 (patch)
tree4538b2b82b0e1f5b859c44a6680d46b763c65a14 /lib
parentb2aaaaf40cdbc887d50cc0b504e25e199fcb3b13 (diff)
getgroups(): clarify code
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_lowlevel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index c3724a6..c1c573f 100644
--- 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;
}