projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9272a9d
)
Bugfix (spotted by Nathan McSween): xread can't detect <0 if the return type is store...
author
Rob Landley
<rob@landley.net>
Wed, 28 Dec 2011 19:01:12 +0000
(13:01 -0600)
committer
Rob Landley
<rob@landley.net>
Wed, 28 Dec 2011 19:01:12 +0000
(13:01 -0600)
lib/lib.c
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
8e557a8
..
82e32ae
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-246,10
+246,10
@@
ssize_t writeall(int fd, void *buf, size_t len)
// Die if there's an error other than EOF.
size_t xread(int fd, void *buf, size_t len)
{
-
len
= read(fd, buf, len);
- if (
len
< 0) perror_exit("xread");
+
ssize_t ret
= read(fd, buf, len);
+ if (
ret
< 0) perror_exit("xread");
- return
len
;
+ return
ret
;
}
void xreadall(int fd, void *buf, size_t len)