diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index bc715733f884..ea257a56e3e0 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.78 1997/09/16 23:15:13 brian Exp $ + * $Id: main.c,v 1.79 1997/09/18 00:15:25 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -711,7 +711,6 @@ DoLoop() if (OpenModem(mode) < 0) return; LogPrintf(LogPHASE, "Packet mode enabled\n"); - close(0); PacketMode(); } else if (mode & MODE_DEDICATED) { if (modem < 0) diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index 35f52b2bcccf..9cd0098c2290 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.52 1997/09/16 23:15:14 brian Exp $ + * $Id: modem.c,v 1.53 1997/09/18 00:15:25 brian Exp $ * * TODO: */ @@ -442,20 +442,9 @@ OpenModem(int mode) LogPrintf(LogDEBUG, "OpenModem: Modem is already open!\n"); /* We're going back into "term" mode */ else if (mode & MODE_DIRECT) { - if (isatty(0)) { - char *dev; - modem = open(dev = ctermid(NULL), O_RDWR | O_NONBLOCK); - if (modem < 0) { - LogPrintf(LogERROR, "OpenModem(direct) failed: %s: %s\n", - dev, strerror(errno)); - return (-1); - } - LogPrintf(LogDEBUG, "OpenModem(direct): Modem is a tty\n"); - } else { - /* must be a tcp connection */ - LogPrintf(LogDEBUG, "OpenModem(direct): Modem is not a tty\n"); - return modem = dup(0); - } + LogPrintf(LogDEBUG, "OpenModem(direct): Modem is %sa tty\n", + isatty(0) ? "" : "not "); + return modem = 0; } else { if (strncmp(VarDevice, "/dev/", 5) == 0) { if ((res = uu_lock(VarBaseDevice)) != UU_LOCK_OK) {