From d5cffd6633270052181503e5a2e5b9a10bde251e Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 9 Mar 2017 17:02:39 +0000 Subject: Move server_fill_environ into environ.c and move some other common code into it. --- usr.bin/tmux/job.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'usr.bin/tmux/job.c') diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c index 7f037b295cc..9f50311c40d 100644 --- a/usr.bin/tmux/job.c +++ b/usr.bin/tmux/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.41 2016/10/10 21:29:23 nicm Exp $ */ +/* $OpenBSD: job.c,v 1.42 2017/03/09 17:02:38 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -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); -- cgit v1.2.3