aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-02-28 16:38:25 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-02-28 16:38:25 +0100
commit577235dee826eed86d76b0d4ef866297a20ecd55 (patch)
treea68b8e185ca6c4678725c749a13ba892bbb2e08f
parent7794c21daf452912275f0f51d6edd4614c43eccf (diff)
downloadbusybox-w32-577235dee826eed86d76b0d4ef866297a20ecd55.tar.gz
busybox-w32-577235dee826eed86d76b0d4ef866297a20ecd55.tar.bz2
busybox-w32-577235dee826eed86d76b0d4ef866297a20ecd55.zip
code shrink in check_errors_in_children()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/libarchive/open_transformer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index dae04aa57..4e44a87e9 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -34,6 +34,7 @@ void check_errors_in_children(int signo)
34 if (!signo) { 34 if (!signo) {
35 /* block waiting for any child */ 35 /* block waiting for any child */
36 if (wait(&status) < 0) 36 if (wait(&status) < 0)
37//FIXME: check EINTR?
37 return; /* probably there are no children */ 38 return; /* probably there are no children */
38 goto check_status; 39 goto check_status;
39 } 40 }
@@ -41,14 +42,18 @@ void check_errors_in_children(int signo)
41 /* Wait for any child without blocking */ 42 /* Wait for any child without blocking */
42 for (;;) { 43 for (;;) {
43 if (wait_any_nohang(&status) < 0) 44 if (wait_any_nohang(&status) < 0)
45//FIXME: check EINTR?
44 /* wait failed?! I'm confused... */ 46 /* wait failed?! I'm confused... */
45 return; 47 return;
46 check_status: 48 check_status:
47 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) 49 /*if (WIFEXITED(status) && WEXITSTATUS(status) == 0)*/
50 /* On Linux, the above can be checked simply as: */
51 if (status == 0)
48 /* this child exited with 0 */ 52 /* this child exited with 0 */
49 continue; 53 continue;
50 /* Cannot happen? 54 /* Cannot happen:
51 if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???; */ 55 if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???;
56 */
52 bb_got_signal = 1; 57 bb_got_signal = 1;
53 } 58 }
54} 59}