Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Jeff King
On Mon, Apr 01, 2013 at 11:22:36PM -0600, Felipe Contreras wrote: > On Mon, Apr 1, 2013 at 11:14 PM, Jeff King wrote: > > On Mon, Apr 01, 2013 at 11:11:20PM -0600, Felipe Contreras wrote: > > > >> > But if we know from reading waitpid(3) that waitpid should only fail due > >> > to EINTR, or due t

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Felipe Contreras
On Mon, Apr 1, 2013 at 11:14 PM, Jeff King wrote: > On Mon, Apr 01, 2013 at 11:11:20PM -0600, Felipe Contreras wrote: > >> > But if we know from reading waitpid(3) that waitpid should only fail due >> > to EINTR, or due to bogus arguments (e.g., a pid that does not exist or >> > has already been r

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Jeff King
On Mon, Apr 01, 2013 at 11:11:20PM -0600, Felipe Contreras wrote: > > But if we know from reading waitpid(3) that waitpid should only fail due > > to EINTR, or due to bogus arguments (e.g., a pid that does not exist or > > has already been reaped), then maybe something like this makes sense: > > >

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Felipe Contreras
On Mon, Apr 1, 2013 at 8:22 PM, Jeff King wrote: > On Mon, Apr 01, 2013 at 05:58:55PM -0600, Felipe Contreras wrote: >> Are you saying that even if we have stored the result of a waitpid >> command, if errno is EINTR, then we should still loop waitpid()? If >> so, I guess this would do the trick:

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Jeff King
On Mon, Apr 01, 2013 at 05:58:55PM -0600, Felipe Contreras wrote: > On Mon, Apr 1, 2013 at 5:23 PM, Jeff King wrote: > > On Mon, Apr 01, 2013 at 03:46:41PM -0600, Felipe Contreras wrote: > > >> -static int wait_or_whine(pid_t pid, const char *argv0) > >> +static pid_t persistent_waitpid(struct c

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Felipe Contreras
On Mon, Apr 1, 2013 at 5:23 PM, Jeff King wrote: > On Mon, Apr 01, 2013 at 03:46:41PM -0600, Felipe Contreras wrote: >> -static int wait_or_whine(pid_t pid, const char *argv0) >> +static pid_t persistent_waitpid(struct child_process *cmd, pid_t pid, int >> *stat_loc) >> +{ >> + if (cmd->last

Re: [PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Jeff King
On Mon, Apr 01, 2013 at 03:46:41PM -0600, Felipe Contreras wrote: > And persistent_waitpid() to recover the information from the last run. > > Signed-off-by: Felipe Contreras A little background would be nice here...what problem are we solving? > -static int wait_or_whine(pid_t pid, const char

[PATCH 1/4] run-command: add new check_command helper

2013-04-01 Thread Felipe Contreras
And persistent_waitpid() to recover the information from the last run. Signed-off-by: Felipe Contreras --- run-command.c | 46 -- run-command.h | 6 ++ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/run-command.c b/run-command.c i