Move server_fill_environ into environ.c and move some other common code

into it.
This commit is contained in:
nicm
2017-03-09 17:02:38 +00:00
parent e8f2609ca4
commit dbfee6a468
8 changed files with 40 additions and 52 deletions

7
job.c
View File

@ -53,12 +53,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)
return (NULL);
env = environ_create();
environ_copy(global_environ, env);
if (s != NULL)
environ_copy(s->environ, env);
server_fill_environ(s, env);
env = environ_for_session(s);
switch (pid = fork()) {
case -1:
environ_free(env);