summaryrefslogtreecommitdiff
path: root/sshpty.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-06-15 00:04:23 +0000
committerKevin Steves <stevesk@pobox.com>2001-06-15 00:04:23 +0000
commit974fb9cf2fa820971e0da31a0acf99241c14e48d (patch)
tree9fb2b5e765688e4f3c81829830b62153e5f09cb6 /sshpty.c
parent7a83722577b5aa04c65e3b5314a77ae4012904e3 (diff)
downloadopenssh-git-974fb9cf2fa820971e0da31a0acf99241c14e48d.tar.gz
- (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL
around grantpt().
Diffstat (limited to 'sshpty.c')
-rw-r--r--sshpty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshpty.c b/sshpty.c
index 4af55e92..4083e249 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -20,6 +20,7 @@ RCSID("$OpenBSD: sshpty.c,v 1.1 2001/03/04 01:46:30 djm Exp $");
#include "sshpty.h"
#include "log.h"
+#include "misc.h"
/* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */
#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY)
@@ -93,16 +94,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
*/
int ptm;
char *pts;
+ mysig_t old_signal;
ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY);
if (ptm < 0) {
error("/dev/ptmx: %.100s", strerror(errno));
return 0;
}
+ old_signal = mysignal(SIGCHLD, SIG_DFL);
if (grantpt(ptm) < 0) {
error("grantpt: %.100s", strerror(errno));
return 0;
}
+ mysignal(SIGCHLD, old_signal);
if (unlockpt(ptm) < 0) {
error("unlockpt: %.100s", strerror(errno));
return 0;