← Commit list

9dedf72e7

Denis Vlasenko
Denis Vlasenko
2008-04-01
FAILED Duration: 23s

Subject

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

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/script.c+5 -1
@@ -115,7 +115,11 @@ int script_main(int argc ATTRIBUTE_UNUSED, char **argv)
/* 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) {