Re: [PATCH v4 05/10] run-command: prepare child environment before forking

2017-04-18 Thread Brandon Williams
On 04/18, Eric Wong wrote: > > +static int env_isequal(const char *e1, const char *e2) > > +{ > > + for (;;) { > > + char c1 = *e1++; > > + char c2 = *e2++; > > + c1 = (c1 == '=') ? '\0' : tolower(c1); > > + c2 = (c2 == '=') ? '\0' : tolower(c2); > > Deali

Re: [PATCH v4 05/10] run-command: prepare child environment before forking

2017-04-17 Thread Eric Wong
+Cc Karsten for comments below... Brandon Williams wrote: > In order to avoid allocation between 'fork()' and 'exec()' prepare the > environment to be used in the child process prior to forking. > > Switch to using 'execve()' so that the construct child environment can > used in the exec'd proce

[PATCH v4 05/10] run-command: prepare child environment before forking

2017-04-17 Thread Brandon Williams
In order to avoid allocation between 'fork()' and 'exec()' prepare the environment to be used in the child process prior to forking. Switch to using 'execve()' so that the construct child environment can used in the exec'd process. Signed-off-by: Brandon Williams --- run-command.c | 87