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:
f15387d
)
Tweak from Roberto Foglietta.
author
Rob Landley
<rob@landley.net>
Fri, 18 Jul 2008 13:43:18 +0000
(08:43 -0500)
committer
Rob Landley
<rob@landley.net>
Fri, 18 Jul 2008 13:43:18 +0000
(08:43 -0500)
lib/lib.c
patch
|
blob
|
history
lib/lib.h
patch
|
blob
|
history
diff --git
a/lib/lib.c
b/lib/lib.c
index
d156893
..
8f74289
100644
(file)
--- a/
lib/lib.c
+++ b/
lib/lib.c
@@
-550,7
+550,7
@@
char *readfile(char *name)
if (fd == -1) return 0;
len = fdlength(fd);
buf = xmalloc(len+1);
- buf[xread(fd, buf, len)] = 0;
+ buf[xread
all
(fd, buf, len)] = 0;
return buf;
}
diff --git
a/lib/lib.h
b/lib/lib.h
index
db283cf
..
cfbeeb3
100644
(file)
--- a/
lib/lib.h
+++ b/
lib/lib.h
@@
-73,6
+73,8
@@
ssize_t writeall(int fd, void *buf, size_t len);
size_t xread(int fd, void *buf, size_t len);
void xreadall(int fd, void *buf, size_t len);
void xwrite(int fd, void *buf, size_t len);
+char *readfile(char *name);
+char *xreadfile(char *name);
char *xgetcwd(void);
void xstat(char *path, struct stat *st);
char *xabspath(char *path);