1 |
|
Sat Aug 9 18:28:01 BST 2003 Colin Watson <cjwatson@debian.org> |
2 |
|
|
3 |
|
Replace the old "wait() for one child at a time" approach with a |
4 |
|
SIGCHLD-handling edifice that collects children's exit statuses as |
5 |
|
they die. |
6 |
|
|
7 |
|
* lib/pipeline.c (pipeline_new): Initialize statuses. |
8 |
|
(pipeline_join): Set statuses to NULL in joined pipeline. |
9 |
|
(pipeline_join, pipeline_get_infile, pipeline_get_outfile, |
10 |
|
pipeline_start, pipeline_wait): Assert that statuses field is NULL |
11 |
|
or non-NULL as appropriate. |
12 |
|
(pipeline_free): Free statuses if necessary. |
13 |
|
|
14 |
|
(pipeline_start): Add p to a new active_pipelines array, to be |
15 |
|
used while reaping children. Initialize statuses elements to -1. |
16 |
|
Block SIGCHLD while forking children. |
17 |
|
(reap_children): New function. Delivers collected exit statuses |
18 |
|
into statuses fields of entries in active_pipelines. |
19 |
|
(pipeline_wait): Rather than wait()ing manually here, check |
20 |
|
whether any statuses have been picked up by the SIGCHLD handler, |
21 |
|
and if not call reap_children(). Remove now-obsolete TODO comment. |
22 |
|
(pipeline_sigchld): New function, the SIGCHLD handler. |
23 |
|
(pipeline_install_sigchld): New function, to be called once per |
24 |
|
program. |
25 |
|
|
26 |
|
(pipeline_start, pipeline_wait): Add minimal debugging |
27 |
|
information. |
28 |
|
|
29 |
|
* lib/pipeline.h: Prototype new functions. |
30 |
|
(struct pipeline): New statuses member. |
31 |
|
|
32 |
Sat Aug 9 17:00:12 BST 2003 Colin Watson <cjwatson@debian.org> |
Sat Aug 9 17:00:12 BST 2003 Colin Watson <cjwatson@debian.org> |
33 |
|
|
34 |
* lib/pipeline.c (command_dup): Copy cmd->nice. |
* lib/pipeline.c (command_dup): Copy cmd->nice. |