Re: [PATCH v3 07/10] run-command: eliminate calls to error handling functions in child

2017-04-14 Thread Brandon Williams
On 04/14, Eric Wong wrote: > Brandon Williams wrote: > > +++ b/run-command.c > > @@ -211,14 +211,82 @@ static const char **prepare_shell_cmd(struct > > argv_array *out, const char **argv) > > #ifndef GIT_WINDOWS_NATIVE > > static int child_notifier = -1; > > > > -static void notify_parent(voi

Re: [PATCH v3 07/10] run-command: eliminate calls to error handling functions in child

2017-04-14 Thread Eric Wong
Brandon Williams wrote: > +++ b/run-command.c > @@ -211,14 +211,82 @@ static const char **prepare_shell_cmd(struct argv_array > *out, const char **argv) > #ifndef GIT_WINDOWS_NATIVE > static int child_notifier = -1; > > -static void notify_parent(void) > +enum child_errcode { > + CHILD_ER

[PATCH v3 07/10] run-command: eliminate calls to error handling functions in child

2017-04-14 Thread Brandon Williams
All of our standard error handling paths have the potential to call malloc or take stdio locks; so we must avoid them inside the forked child. Instead, the child only writes an 8 byte struct atomically to the parent through the notification pipe to propagate an error. All user-visible error report