OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2bfaaf2
)
Bug spotted by Roberto Foglietta: at EOF readall() should return count, not len.
author
Rob Landley
<rob@landley.net>
Fri, 18 Jul 2008 09:15:59 +0000
(
04:15
-0500)
committer
Rob Landley
<rob@landley.net>
Fri, 18 Jul 2008 09:15:59 +0000
(
04:15
-0500)
lib/lib.c
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
8467f86
..
959cd46
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-219,9
+219,10
@@
FILE *xfopen(char *path, char *mode)
ssize_t readall(int fd, void *buf, size_t len)
{
size_t count = 0;
+
while (count<len) {
int i = read(fd, buf+count, len-count);
- if (!i)
return len
;
+ if (!i)
break
;
if (i<0) return i;
count += i;
}