diff options
Diffstat (limited to 'sshpty.c')
-rw-r--r-- | sshpty.c | 13 |
1 files changed, 0 insertions, 13 deletions
@@ -99,9 +99,6 @@ void | |||
99 | pty_make_controlling_tty(int *ttyfd, const char *tty) | 99 | pty_make_controlling_tty(int *ttyfd, const char *tty) |
100 | { | 100 | { |
101 | int fd; | 101 | int fd; |
102 | #ifdef USE_VHANGUP | ||
103 | void *old; | ||
104 | #endif /* USE_VHANGUP */ | ||
105 | 102 | ||
106 | #ifdef _UNICOS | 103 | #ifdef _UNICOS |
107 | if (setsid() < 0) | 104 | if (setsid() < 0) |
@@ -157,21 +154,11 @@ pty_make_controlling_tty(int *ttyfd, const char *tty) | |||
157 | if (setpgrp(0,0) < 0) | 154 | if (setpgrp(0,0) < 0) |
158 | error("SETPGRP %s",strerror(errno)); | 155 | error("SETPGRP %s",strerror(errno)); |
159 | #endif /* NEED_SETPGRP */ | 156 | #endif /* NEED_SETPGRP */ |
160 | #ifdef USE_VHANGUP | ||
161 | old = signal(SIGHUP, SIG_IGN); | ||
162 | vhangup(); | ||
163 | signal(SIGHUP, old); | ||
164 | #endif /* USE_VHANGUP */ | ||
165 | fd = open(tty, O_RDWR); | 157 | fd = open(tty, O_RDWR); |
166 | if (fd < 0) { | 158 | if (fd < 0) { |
167 | error("%.100s: %.100s", tty, strerror(errno)); | 159 | error("%.100s: %.100s", tty, strerror(errno)); |
168 | } else { | 160 | } else { |
169 | #ifdef USE_VHANGUP | ||
170 | close(*ttyfd); | ||
171 | *ttyfd = fd; | ||
172 | #else /* USE_VHANGUP */ | ||
173 | close(fd); | 161 | close(fd); |
174 | #endif /* USE_VHANGUP */ | ||
175 | } | 162 | } |
176 | /* Verify that we now have a controlling tty. */ | 163 | /* Verify that we now have a controlling tty. */ |
177 | fd = open(_PATH_TTY, O_WRONLY); | 164 | fd = open(_PATH_TTY, O_WRONLY); |