svn commit: trunk/busybox/libbb

landley at busybox.net landley at busybox.net
Fri Nov 4 01:54:25 UTC 2005


Author: landley
Date: 2005-11-03 17:54:15 -0800 (Thu, 03 Nov 2005)
New Revision: 12147

Log:
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?


Modified:
   trunk/busybox/libbb/copyfd.c


Changeset:
Modified: trunk/busybox/libbb/copyfd.c
===================================================================
--- trunk/busybox/libbb/copyfd.c	2005-11-04 01:20:46 UTC (rev 12146)
+++ trunk/busybox/libbb/copyfd.c	2005-11-04 01:54:15 UTC (rev 12147)
@@ -33,7 +33,7 @@
 	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);




More information about the busybox-cvs mailing list