Unlink socket when forkpty fails

This commit is contained in:
Marc André Tanner 2014-02-24 17:29:17 +01:00
parent c999a6322b
commit d9929a0570
1 changed files with 1 additions and 0 deletions

View File

@ -282,6 +282,7 @@ static bool create_session(const char *name, char * const argv[]) {
wait(&status); /* wait for first fork */
if ((status = read_all(pipefds[0], errormsg, sizeof(errormsg))) > 0) {
write_all(STDERR_FILENO, errormsg, status);
unlink(sockaddr.sun_path);
exit(EXIT_FAILURE);
}
close(pipefds[0]);