mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-11 05:33:55 -04:00
slave: report exec() failure back to main process
This commit is contained in:
parent
519f721577
commit
aa87be43ba
3 changed files with 44 additions and 15 deletions
3
slave.c
3
slave.c
|
|
@ -92,7 +92,7 @@ err:
|
|||
}
|
||||
|
||||
void
|
||||
slave_spawn(int ptmx, char *cmd)
|
||||
slave_spawn(int ptmx, char *cmd, int err_fd)
|
||||
{
|
||||
int pts = -1;
|
||||
const char *pts_name = ptsname(ptmx);
|
||||
|
|
@ -138,6 +138,7 @@ slave_spawn(int ptmx, char *cmd)
|
|||
execvp(argv[0], argv);
|
||||
|
||||
err:
|
||||
(void)!write(err_fd, &errno, sizeof(errno));
|
||||
if (argv)
|
||||
free(argv);
|
||||
if (pts != -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue