diff options
author | nicm <nicm> | 2021-02-19 09:09:16 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-02-19 09:09:16 +0000 |
commit | b04f8acb7057bda74e30976acedbbd73767e5bdc (patch) | |
tree | 8b3be4d6a36b2dcc2fb668a510f94f4d3a1ec1d0 /spawn.c | |
parent | fb42ae3071763fdc6a2fe2e57feec774623b1c33 (diff) | |
download | rtmux-b04f8acb7057bda74e30976acedbbd73767e5bdc.tar.gz rtmux-b04f8acb7057bda74e30976acedbbd73767e5bdc.tar.bz2 rtmux-b04f8acb7057bda74e30976acedbbd73767e5bdc.zip |
Check return value of chdir() to stop a silly warning with some
compilers, GitHub issue 2573.
Diffstat (limited to 'spawn.c')
-rw-r--r-- | spawn.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -379,10 +379,10 @@ spawn_pane(struct spawn_context *sc, char **cause) * Child process. Change to the working directory or home if that * fails. */ - if (chdir(new_wp->cwd) != 0) { - if ((tmp = find_home()) == NULL || chdir(tmp) != 0) - chdir("/"); - } + if (chdir(new_wp->cwd) != 0 && + ((tmp = find_home()) == NULL || chdir(tmp) != 0) && + chdir("/") != 0) + fatal("chdir failed"); /* * Update terminal escape characters from the session if available and |