aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/SunOS.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c
index ba3039a6..97cae2dc 100644
--- a/src/cmd/9term/SunOS.c
+++ b/src/cmd/9term/SunOS.c
@@ -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);