From 3fc4ad1478e1c170d5a939104d5278ac90ca9e6f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 4 Nov 2005 01:54:15 +0000 Subject: 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? --- libbb/copyfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb/copyfd.c') 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) 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); -- cgit v1.2.3