- (djm) Cleanup sshpty.c a little

This commit is contained in:
Damien Miller 2001-10-12 19:15:48 +10:00
parent 7c734056f4
commit 4a820ea750
2 changed files with 12 additions and 12 deletions

View File

@ -17,6 +17,7 @@
clear select masks if we return before calling select(). clear select masks if we return before calling select().
- (djm) "make veryclean" fix from Tom Holroyd <tomh@po.crl.go.jp> - (djm) "make veryclean" fix from Tom Holroyd <tomh@po.crl.go.jp>
- (djm) Clean some autoconf-2.52 junk when doing "make distclean" - (djm) Clean some autoconf-2.52 junk when doing "make distclean"
- (djm) Cleanup sshpty.c a little
20011010 20011010
- (djm) OpenBSD CVS Sync - (djm) OpenBSD CVS Sync
@ -6715,4 +6716,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1605 2001/10/12 09:15:27 djm Exp $ $Id: ChangeLog,v 1.1606 2001/10/12 09:15:48 djm Exp $

View File

@ -249,17 +249,20 @@ pty_release(const char *ttyname)
void void
pty_make_controlling_tty(int *ttyfd, const char *ttyname) pty_make_controlling_tty(int *ttyfd, const char *ttyname)
{ {
#ifdef _CRAY
int fd; int fd;
#ifdef USE_VHANGUP
void *old;
#endif /* USE_VHANGUP */
#ifdef _CRAY
if (setsid() < 0) if (setsid() < 0)
error("setsid: %.100s", strerror(errno)); error("setsid: %.100s", strerror(errno));
fd = open(ttyname, O_RDWR|O_NOCTTY); fd = open(ttyname, O_RDWR|O_NOCTTY);
if (fd != -1) { if (fd != -1) {
signal(SIGHUP, SIG_IGN); mysignal(SIGHUP, SIG_IGN);
ioctl(fd, TCVHUP, (char *)NULL); ioctl(fd, TCVHUP, (char *)NULL);
signal(SIGHUP, SIG_DFL); mysignal(SIGHUP, SIG_DFL);
setpgid(0, 0); setpgid(0, 0);
close(fd); close(fd);
} else { } else {
@ -273,11 +276,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
error("%.100s: %.100s", ttyname, strerror(errno)); error("%.100s: %.100s", ttyname, strerror(errno));
close(*ttyfd); close(*ttyfd);
*ttyfd = fd; *ttyfd = fd;
#else #else /* _CRAY */
int fd;
#ifdef USE_VHANGUP
void *old;
#endif /* USE_VHANGUP */
/* First disconnect from the old controlling tty. */ /* First disconnect from the old controlling tty. */
#ifdef TIOCNOTTY #ifdef TIOCNOTTY
@ -310,9 +309,9 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
error("SETPGRP %s",strerror(errno)); error("SETPGRP %s",strerror(errno));
#endif /* HAVE_NEWS4 */ #endif /* HAVE_NEWS4 */
#ifdef USE_VHANGUP #ifdef USE_VHANGUP
old = signal(SIGHUP, SIG_IGN); old = mysignal(SIGHUP, SIG_IGN);
vhangup(); vhangup();
signal(SIGHUP, old); mysignal(SIGHUP, old);
#endif /* USE_VHANGUP */ #endif /* USE_VHANGUP */
fd = open(ttyname, O_RDWR); fd = open(ttyname, O_RDWR);
if (fd < 0) { if (fd < 0) {
@ -333,7 +332,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
else { else {
close(fd); close(fd);
} }
#endif #endif /* _CRAY */
} }
/* Changes the window size associated with the pty. */ /* Changes the window size associated with the pty. */