forked from github/abduco
Unlink socket when forkpty fails
This commit is contained in:
parent
c999a6322b
commit
d9929a0570
1
abduco.c
1
abduco.c
|
|
@ -282,6 +282,7 @@ static bool create_session(const char *name, char * const argv[]) {
|
||||||
wait(&status); /* wait for first fork */
|
wait(&status); /* wait for first fork */
|
||||||
if ((status = read_all(pipefds[0], errormsg, sizeof(errormsg))) > 0) {
|
if ((status = read_all(pipefds[0], errormsg, sizeof(errormsg))) > 0) {
|
||||||
write_all(STDERR_FILENO, errormsg, status);
|
write_all(STDERR_FILENO, errormsg, status);
|
||||||
|
unlink(sockaddr.sun_path);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
close(pipefds[0]);
|
close(pipefds[0]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue