The invoked child process might end before the I/O loop finished outputting
all data. In such a case, the splice() call might fail with -1/EINTR.
Continue looping in such a case.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
do {
len = splice(fds[0], NULL, 1, NULL, READ_BLOCK, SPLICE_F_MORE);
- } while (len > 0);
+ } while (len > 0 || (len == -1 && errno == EINTR));
waitpid(pid, &status, 0);
do {
len = splice(fds[0], NULL, 1, NULL, READ_BLOCK, SPLICE_F_MORE);
- } while (len > 0);
+ } while (len > 0 || (len == -1 && errno == EINTR));
waitpid(pid, &status, 0);