summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-openpty.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-openpty.c')
-rw-r--r--openbsd-compat/bsd-openpty.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c
index 123a9be56..1ab41f42b 100644
--- a/openbsd-compat/bsd-openpty.c
+++ b/openbsd-compat/bsd-openpty.c
@@ -65,6 +65,8 @@
65#include <string.h> 65#include <string.h>
66#include <unistd.h> 66#include <unistd.h>
67 67
68#include "misc.h"
69
68#ifndef O_NOCTTY 70#ifndef O_NOCTTY
69#define O_NOCTTY 0 71#define O_NOCTTY 0
70#endif 72#endif
@@ -97,16 +99,16 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
97 */ 99 */
98 int ptm; 100 int ptm;
99 char *pts; 101 char *pts;
100 mysig_t old_signal; 102 sshsig_t old_signal;
101 103
102 if ((ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1) 104 if ((ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1)
103 return (-1); 105 return (-1);
104 106
105 /* XXX: need to close ptm on error? */ 107 /* XXX: need to close ptm on error? */
106 old_signal = signal(SIGCHLD, SIG_DFL); 108 old_signal = ssh_signal(SIGCHLD, SIG_DFL);
107 if (grantpt(ptm) < 0) 109 if (grantpt(ptm) < 0)
108 return (-1); 110 return (-1);
109 signal(SIGCHLD, old_signal); 111 ssh_signal(SIGCHLD, old_signal);
110 112
111 if (unlockpt(ptm) < 0) 113 if (unlockpt(ptm) < 0)
112 return (-1); 114 return (-1);