summaryrefslogtreecommitdiff
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
parent7a83722577b5aa04c65e3b5314a77ae4012904e3 (diff)
- (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL
around grantpt().
-rw-r--r--ChangeLog6
-rw-r--r--misc.c4
-rw-r--r--sshpty.c4
3 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a8a153506..956bddc35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120010615
2 - (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL
3 around grantpt().
4
120010614 520010614
2 - OpenBSD CVS Sync 6 - OpenBSD CVS Sync
3 - markus@cvs.openbsd.org 2001/06/13 09:10:31 7 - markus@cvs.openbsd.org 2001/06/13 09:10:31
@@ -5644,4 +5648,4 @@
5644 - Wrote replacements for strlcpy and mkdtemp 5648 - Wrote replacements for strlcpy and mkdtemp
5645 - Released 1.0pre1 5649 - Released 1.0pre1
5646 5650
5647$Id: ChangeLog,v 1.1286 2001/06/13 19:23:32 mouring Exp $ 5651$Id: ChangeLog,v 1.1287 2001/06/15 00:04:23 stevesk Exp $
diff --git a/misc.c b/misc.c
index 208819cd2..5e98b8bb3 100644
--- a/misc.c
+++ b/misc.c
@@ -280,10 +280,6 @@ mysignal(int sig, mysig_t act)
280 memset(&sa, 0, sizeof(sa)); 280 memset(&sa, 0, sizeof(sa));
281 sigemptyset(&sa.sa_mask); 281 sigemptyset(&sa.sa_mask);
282 sa.sa_flags = 0; 282 sa.sa_flags = 0;
283#if defined(SA_RESTART)
284 if (sig == SIGCHLD)
285 sa.sa_flags |= SA_RESTART;
286#endif
287#if defined(SA_INTERRUPT) 283#if defined(SA_INTERRUPT)
288 if (sig == SIGALRM) 284 if (sig == SIGALRM)
289 sa.sa_flags |= SA_INTERRUPT; 285 sa.sa_flags |= SA_INTERRUPT;
diff --git a/sshpty.c b/sshpty.c
index 4af55e920..4083e249f 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 $");
20 20
21#include "sshpty.h" 21#include "sshpty.h"
22#include "log.h" 22#include "log.h"
23#include "misc.h"
23 24
24/* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */ 25/* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */
25#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) 26#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY)
@@ -93,16 +94,19 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
93 */ 94 */
94 int ptm; 95 int ptm;
95 char *pts; 96 char *pts;
97 mysig_t old_signal;
96 98
97 ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY); 99 ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY);
98 if (ptm < 0) { 100 if (ptm < 0) {
99 error("/dev/ptmx: %.100s", strerror(errno)); 101 error("/dev/ptmx: %.100s", strerror(errno));
100 return 0; 102 return 0;
101 } 103 }
104 old_signal = mysignal(SIGCHLD, SIG_DFL);
102 if (grantpt(ptm) < 0) { 105 if (grantpt(ptm) < 0) {
103 error("grantpt: %.100s", strerror(errno)); 106 error("grantpt: %.100s", strerror(errno));
104 return 0; 107 return 0;
105 } 108 }
109 mysignal(SIGCHLD, old_signal);
106 if (unlockpt(ptm) < 0) { 110 if (unlockpt(ptm) < 0) {
107 error("unlockpt: %.100s", strerror(errno)); 111 error("unlockpt: %.100s", strerror(errno));
108 return 0; 112 return 0;