Make setsid(2) failure non fatal

The specified error EPERM can only occur if the process is already
a session leader in which case we do not care.
This commit is contained in:
Marc André Tanner 2014-10-02 14:21:19 +02:00
parent 9e6490da33
commit 21f81b81b0
1 changed files with 1 additions and 2 deletions

View File

@ -50,8 +50,7 @@ pid_t forkpty(int *master, char *name, struct termios *tio, struct winsize *ws)
close(fd);
}
if (setsid() < 0)
return -1;
setsid();
fd = open(_PATH_TTY, O_RDWR|O_NOCTTY);
if (fd >= 0)