diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-02-20 09:22:58 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-02-20 10:11:52 +0800 |
commit | ffb84fc1bf1d138d1ac1bb8ece0b7d625f288d97 (patch) | |
tree | fcb5a469816b4b929686f343735a2b2942cf7cf1 /test/lib/Makefile.am | |
parent | 0b3bfb90a292ceba33b649681876ec1ed50c8447 (diff) | |
download | talos-petitboot-ffb84fc1bf1d138d1ac1bb8ece0b7d625f288d97.tar.gz talos-petitboot-ffb84fc1bf1d138d1ac1bb8ece0b7d625f288d97.zip |
lib/process: Don't abort stdout reads on EINTR
If our read() of the process stdout pipe fails with EINTR (eg, if we
receive a SIGCHLD because the process exited), then
process_read_stdout_once will return a non-zero exit code, and we'll
abort any further stdout collection.
Instead, we should check for EINTR, and allow the reads to continue.
This change normalises the return value from process_read_stdout_once to
return positive on success, negative on failure, and zero on competion.
We use a positive return value for the non-error EINTR case.
Also, add a pb_log if the read fails for non-EINTR reasons.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'test/lib/Makefile.am')
-rw-r--r-- | test/lib/Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/lib/Makefile.am b/test/lib/Makefile.am index ed570af..23bee36 100644 --- a/test/lib/Makefile.am +++ b/test/lib/Makefile.am @@ -32,6 +32,7 @@ check_PROGRAMS = list-test \ test-process-async-stdout \ test-process-parent-stdout \ test-process-both \ + test-process-stdout-eintr \ test-fold TESTS = $(check_PROGRAMS) |