mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
term: spawn_new: check return value of chdir() and write()
This commit is contained in:
parent
e751227dc6
commit
01f8719c77
1 changed files with 7 additions and 3 deletions
10
terminal.c
10
terminal.c
|
|
@ -1961,9 +1961,13 @@ term_spawn_new(const struct terminal *term)
|
||||||
if (pid2 == 0) {
|
if (pid2 == 0) {
|
||||||
/* Child */
|
/* Child */
|
||||||
close(pipe_fds[0]);
|
close(pipe_fds[0]);
|
||||||
chdir(term->cwd);
|
if (chdir(term->cwd) < 0 ||
|
||||||
execlp(term->foot_exe, term->foot_exe, NULL);
|
execlp(term->foot_exe, term->foot_exe, NULL) < 0)
|
||||||
write(pipe_fds[1], &errno, sizeof(errno));
|
{
|
||||||
|
(void)!write(pipe_fds[1], &errno, sizeof(errno));
|
||||||
|
_exit(errno);
|
||||||
|
}
|
||||||
|
assert(false);
|
||||||
_exit(errno);
|
_exit(errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue