summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley2005-11-04 01:54:15 +0000
committerRob Landley2005-11-04 01:54:15 +0000
commit3fc4ad1478e1c170d5a939104d5278ac90ca9e6f (patch)
treed43c3f1c32aa512a2bb44f22f81fe6b9502c82ff
parent21ccbb6c0e80ca8374b7868a4d9dbc61a87f6297 (diff)
downloadbusybox-3fc4ad1478e1c170d5a939104d5278ac90ca9e6f.zip
busybox-3fc4ad1478e1c170d5a939104d5278ac90ca9e6f.tar.gz
Fix bug 424: doing full_read breaks things like cat which should return a
chunk of data when they get it and not block until they've buffered 4k. The use case was cat /proc/psaux, but you can also reproduce this by running non-busybox cat by itself and typing things at the command line. Then run busybox cat. Notice how cat is _supposed_ to echo each line back to us as we hit enter?
-rw-r--r--libbb/copyfd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 5915483..c1962e3 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -33,7 +33,7 @@ static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size)
while (!size || total < size)
{
ssize_t wrote, xread = (size && size < BUFSIZ) ? size : BUFSIZ;
- xread = bb_full_read(src_fd, buffer, xread);
+ xread = safe_read(src_fd, buffer, xread);
if (xread > 0) {
/* A -1 dst_fd means we need to fake it... */
wrote = (dst_fd < 0) ? xread : bb_full_write(dst_fd, buffer, xread);