Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-11 Thread Johannes Sixt
Am 11.11.2015 um 21:53 schrieb Stefan Beller: On Wed, Nov 11, 2015 at 12:48 PM, Johannes Sixt wrote: I wonder why task_finish() callback gets to choose a signal. The point here is, IIUC, when one child dies, the others must be halted, too. SIGTERM seems to be the only sensible choice. SIGKILL

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-11 Thread Stefan Beller
On Wed, Nov 11, 2015 at 12:48 PM, Johannes Sixt wrote: >> >> So maybe that was not the right thought and we do have to special case >> SIGTERM here? > > > I wonder why task_finish() callback gets to choose a signal. The point here > is, IIUC, when one child dies, the others must be halted, too. SI

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-11 Thread Johannes Sixt
Am 11.11.2015 um 21:37 schrieb Stefan Beller: including the list and all others this time. if (code < 0) { pp->shutdown = 1; - kill_children(pp, SIGTERM); + kill_children(pp, -c

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-11 Thread Stefan Beller
including the list and all others this time. >> if (code < 0) { >> pp->shutdown = 1; >> - kill_children(pp, SIGTERM); >> + kill_children(pp, -code); > > > I'll see what this means fo

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-07 Thread Johannes Sixt
Am 07.11.2015 um 00:48 schrieb Stefan Beller: Detect if a child stopped working by checking if their stderr pipe was closed instead of checking their state with waitpid. As waitpid is not fully working in Windows, this is an approach which allows for better cross platform operation. (It's less co

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-06 Thread Torsten Bögershausen
On 07.11.15 00:48, Stefan Beller wrote: > > +enum child_state { > + FREE, > + WORKING, > + WAIT_CLEANUP, > +}; This kind of "generic names" feels are begging for name clash, some day, may be in the future. How about something like this: > + GIT_CP_FREE, > + GIT_CP_WORKING,

[PATCH] run-command: detect finished children by closed pipe rather than waitpid

2015-11-06 Thread Stefan Beller
Detect if a child stopped working by checking if their stderr pipe was closed instead of checking their state with waitpid. As waitpid is not fully working in Windows, this is an approach which allows for better cross platform operation. (It's less code, too) Previously we did not close the read p