diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 2faedcf5a234..bc715733f884 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.77 1997/09/04 00:38:19 brian Exp $ + * $Id: main.c,v 1.78 1997/09/16 23:15:13 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -471,7 +471,7 @@ main(int argc, char **argv) if_filename, strerror(errno)); VarTerm = 0; /* We know it's currently stdout */ - close(0); + close(1); close(2); #ifdef DOTTYINIT @@ -482,7 +482,7 @@ main(int argc, char **argv) TtyInit(1); else { setsid(); - close(1); + close(0); } } else { TtyInit(0); @@ -711,6 +711,7 @@ 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 61248aedd69e..35f52b2bcccf 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.51 1997/09/10 02:20:30 brian Exp $ + * $Id: modem.c,v 1.52 1997/09/16 23:15:14 brian Exp $ * * TODO: */ @@ -454,7 +454,7 @@ OpenModem(int mode) } else { /* must be a tcp connection */ LogPrintf(LogDEBUG, "OpenModem(direct): Modem is not a tty\n"); - return modem = dup(1); + return modem = dup(0); } } else { if (strncmp(VarDevice, "/dev/", 5) == 0) {