aboutsummaryrefslogtreecommitdiff
path: root/libbb/copyfd.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-11-04 01:54:15 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-11-04 01:54:15 +0000
commitae69c43901827dce4b7b853948c4f4425a9ffef5 (patch)
treed43c3f1c32aa512a2bb44f22f81fe6b9502c82ff /libbb/copyfd.c
parent59783584ea92ebb97711b7218303eea1454d7780 (diff)
downloadbusybox-w32-ae69c43901827dce4b7b853948c4f4425a9ffef5.tar.gz
busybox-w32-ae69c43901827dce4b7b853948c4f4425a9ffef5.tar.bz2
busybox-w32-ae69c43901827dce4b7b853948c4f4425a9ffef5.zip
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? git-svn-id: svn://busybox.net/trunk/busybox@12147 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--libbb/copyfd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 591548379..c1962e3c6 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)
33 while (!size || total < size) 33 while (!size || total < size)
34 { 34 {
35 ssize_t wrote, xread = (size && size < BUFSIZ) ? size : BUFSIZ; 35 ssize_t wrote, xread = (size && size < BUFSIZ) ? size : BUFSIZ;
36 xread = bb_full_read(src_fd, buffer, xread); 36 xread = safe_read(src_fd, buffer, xread);
37 if (xread > 0) { 37 if (xread > 0) {
38 /* A -1 dst_fd means we need to fake it... */ 38 /* A -1 dst_fd means we need to fake it... */
39 wrote = (dst_fd < 0) ? xread : bb_full_write(dst_fd, buffer, xread); 39 wrote = (dst_fd < 0) ? xread : bb_full_write(dst_fd, buffer, xread);