svn commit: trunk/busybox/util-linux

vda at busybox.net vda at busybox.net
Tue Apr 1 16:12:18 UTC 2008


Author: vda
Date: 2008-04-01 09:12:17 -0700 (Tue, 01 Apr 2008)
New Revision: 21614

Log:
script: do not ignore poll() errors. ~+20 bytes.



Modified:
   trunk/busybox/util-linux/script.c


Changeset:
Modified: trunk/busybox/util-linux/script.c
===================================================================
--- trunk/busybox/util-linux/script.c	2008-04-01 16:07:06 UTC (rev 21613)
+++ trunk/busybox/util-linux/script.c	2008-04-01 16:12:17 UTC (rev 21614)
@@ -115,7 +115,11 @@
 		/* TODO: don't use full_write's, use proper write buffering */
 		while (fd_count) {
 			/* not safe_poll! we want SIGCHLD to EINTR poll */
-			poll(ppfd, fd_count, -1);
+			if (poll(ppfd, fd_count, -1) < 0 && errno != EINTR) {
+				/* If child exits too quickly, we may get EIO:
+				 * for example, try "script -c true" */
+				break;
+			}
 			if (pfd[0].revents) {
 				count = safe_read(0, buf, sizeof(buf));
 				if (count <= 0) {




More information about the busybox-cvs mailing list