aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-01 16:12:17 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-01 16:12:17 +0000
commit9dedf72e7123d028f10dccbb7c5678868e68eb0b (patch)
treef267928a8b36f5005a0f6aa18a50d08ce1c6835b
parent468aea2d8800cc0496383616d82d7c957ae8bc50 (diff)
downloadbusybox-w32-9dedf72e7123d028f10dccbb7c5678868e68eb0b.tar.gz
busybox-w32-9dedf72e7123d028f10dccbb7c5678868e68eb0b.tar.bz2
busybox-w32-9dedf72e7123d028f10dccbb7c5678868e68eb0b.zip
script: do not ignore poll() errors. ~+20 bytes.
-rw-r--r--util-linux/script.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util-linux/script.c b/util-linux/script.c
index 700f0cb0a..5d6f4d924 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -115,7 +115,11 @@ int script_main(int argc ATTRIBUTE_UNUSED, char **argv)
115 /* TODO: don't use full_write's, use proper write buffering */ 115 /* TODO: don't use full_write's, use proper write buffering */
116 while (fd_count) { 116 while (fd_count) {
117 /* not safe_poll! we want SIGCHLD to EINTR poll */ 117 /* not safe_poll! we want SIGCHLD to EINTR poll */
118 poll(ppfd, fd_count, -1); 118 if (poll(ppfd, fd_count, -1) < 0 && errno != EINTR) {
119 /* If child exits too quickly, we may get EIO:
120 * for example, try "script -c true" */
121 break;
122 }
119 if (pfd[0].revents) { 123 if (pfd[0].revents) {
120 count = safe_read(0, buf, sizeof(buf)); 124 count = safe_read(0, buf, sizeof(buf));
121 if (count <= 0) { 125 if (count <= 0) {