diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 0bb9c7d16388..e06517a0c7d1 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.6 1998/05/23 22:28:19 brian Exp $ + * $Id: bundle.c,v 1.7 1998/05/25 02:22:30 brian Exp $ */ #include @@ -1450,7 +1450,7 @@ bundle_SendDatalink(struct datalink *dl, int s, struct sockaddr_un *sun) msg.msg_iov = iov; msg.msg_iovlen = niov; - if (link_fd == STDIN_FILENO && isatty(link_fd)) { + if (tcgetpgrp(link_fd) == getpgrp()) { /* * We can't transfer this tty descriptor. If we do, then once the * session leader exits, the descriptor becomes unusable by the @@ -1480,7 +1480,7 @@ bundle_SendDatalink(struct datalink *dl, int s, struct sockaddr_un *sun) /* We must get the ACK before closing the descriptor ! */ read(s, &ack, 1); - if (link_fd == STDIN_FILENO && isatty(link_fd)) { + if (tcgetpgrp(link_fd) == getpgrp()) { /* We use `/bin/cat' to keep the tty session id */ pid_t pid; int status, len, fd; diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index 1b7f6eeb767b..01bdab0f1e5c 100644 --- a/usr.sbin/ppp/modem.c +++ b/usr.sbin/ppp/modem.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: modem.c,v 1.83 1998/05/23 22:24:44 brian Exp $ + * $Id: modem.c,v 1.84 1998/05/25 02:22:37 brian Exp $ * * TODO: */ @@ -1051,7 +1051,7 @@ modem2iov(struct physical *p, struct iovec *iov, int *niov, int maxiov) timer_Stop(&p->link.ccp.fsm.StoppedTimer); if (p->Timer.state != TIMER_STOPPED) { timer_Stop(&p->Timer); - if (!physical_IsATTY(p) || p->fd != STDIN_FILENO) + if (tcgetpgrp(p->fd) == getpgrp()) p->Timer.state = TIMER_RUNNING; /* Special - see iov2modem() */ } timer_Stop(&p->link.throughput.Timer);