diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-02-19 10:01:19 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-02-19 10:01:19 +0000 |
commit | 742e67080586e212f3c6adbdc1c59bf56b0712b1 (patch) | |
tree | c5cb12542b0218f3fc94bf04b77f393fcad631a5 /job.c | |
parent | 11e404ca3c80893f59b1001f000c9390216c7e7a (diff) | |
parent | b04f8acb7057bda74e30976acedbbd73767e5bdc (diff) |
Merge branch 'obsd-master' into master
Diffstat (limited to 'job.c')
-rw-r--r-- | job.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -112,10 +112,10 @@ job_run(const char *cmd, struct session *s, const char *cwd, proc_clear_signals(server_proc, 1); sigprocmask(SIG_SETMASK, &oldset, NULL); - if (cwd == NULL || chdir(cwd) != 0) { - if ((home = find_home()) == NULL || chdir(home) != 0) - chdir("/"); - } + if ((cwd == NULL || chdir(cwd) != 0) && + ((home = find_home()) == NULL || chdir(home) != 0) && + chdir("/") != 0) + fatal("chdir failed"); environ_push(env); environ_free(env); |