Maybe it will run on SunOS 5.8 now.

This commit is contained in:
rsc 2005-02-08 18:01:04 +00:00
parent dd4afdf4eb
commit dc305d0368
2 changed files with 20 additions and 1 deletions

View file

@ -9,8 +9,14 @@
int
getpts(int fd[], char *slave)
{
void (*f)(int);
int r;
fd[1] = open("/dev/ptmx", ORDWR);
if ((grantpt(fd[1]) < 0) || (unlockpt(fd[1]) < 0))
f = signal(SIGCLD, SIG_DFL);
r = grantpt(fd[1]);
signal(SIGCLD, f);
if(r < 0 || unlockpt(fd[1]) < 0)
return -1;
fchmod(fd[1], 0622);