- struct pollfd pollfd[2];
- char buf[LINE_MAX];
- ssize_t buf_got;
-
- pollfd[0].fd = amaster;
- pollfd[0].events = POLLIN;
- pollfd[1].fd = pipefd[0];
- pollfd[1].events = POLLIN;
- i = poll (pollfd, LENGTH (pollfd), -1);
- if (i == -1 && errno == EINTR)
- {
- /* Weird but SA_RESTART sometimes does not work. */
- continue;
- }
- assert (i >= 1);
+ struct pollfd pollfd;
+
+ pollfd.fd = amaster;
+ pollfd.events = POLLIN;
+ i = ppoll (&pollfd, 1, NULL, &set);
+ if (i == -1 && errno == EINTR && signal_chld_hit)
+ break;
+ assert (i == 1);