diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 87f9740abcd4..f80b6b286da7 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.14 1996/01/30 11:08:41 dfr Exp $ + * $Id: main.c,v 1.15 1996/03/08 09:03:05 ache Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -396,7 +396,16 @@ char **argv; #endif TtyInit(); } else { + int fd; + setsid(); /* detach control tty */ + if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { + (void)dup2(fd, STDIN_FILENO); + (void)dup2(fd, STDOUT_FILENO); + (void)dup2(fd, STDERR_FILENO); + if (fd > 2) + (void)close (fd); + } } } else { server = -1; diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index 444c12b242ee..d69d732b8166 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.13 1996/03/08 09:03:07 ache Exp $ + * $Id: modem.c,v 1.14 1996/03/08 12:34:40 ache Exp $ * * TODO: */ @@ -457,6 +457,8 @@ int mode; #else rstio.c_cflag = (CS8 | CREAD | CLOCAL); #endif + if (!(mode & MODE_DEDICATED)) + rstio.c_cflag |= HUPCL; if ((mode & MODE_DIRECT) == 0) { /* * If we are working as direct mode, don't change tty speed. @@ -532,6 +534,8 @@ int modem; modemios = rstio; rstio.c_cflag &= ~(CSIZE|PARENB|PARODD); rstio.c_cflag |= CS8; + if (!(mode & MODE_DEDICATED)) + rstio.c_cflag |= HUPCL; rstio.c_iflag &= ~(ISTRIP|IXON|IXOFF|BRKINT|ICRNL|INLCR); tcsetattr(modem, TCSADRAIN, &rstio); oldflag = fcntl(modem, F_GETFL, 0); diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8 index 78c30a65e16c..425da21cb9a1 100644 --- a/usr.sbin/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp.8 @@ -1,5 +1,5 @@ .\" manual page [] for ppp 0.94 beta2 + alpha -.\" $Id: ppp.8,v 1.13 1996/01/30 13:50:10 mpp Exp $ +.\" $Id: ppp.8,v 1.14 1996/03/08 09:03:08 ache Exp $ .Dd 20 September 1995 .Os FreeBSD .Dt PPP 8 @@ -9,7 +9,8 @@ Point to Point Protocol (aka iijppp) .Sh SYNOPSIS .Nm -.Op Fl auto \*(Ba Fl direct Fl dedicated +.Op Fl auto | Fl direct | Fl dedicated +.Op Ar system .Sh DESCRIPTION This is a user process .Em PPP diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4 index 78c30a65e16c..425da21cb9a1 100644 --- a/usr.sbin/ppp/ppp.8.m4 +++ b/usr.sbin/ppp/ppp.8.m4 @@ -1,5 +1,5 @@ .\" manual page [] for ppp 0.94 beta2 + alpha -.\" $Id: ppp.8,v 1.13 1996/01/30 13:50:10 mpp Exp $ +.\" $Id: ppp.8,v 1.14 1996/03/08 09:03:08 ache Exp $ .Dd 20 September 1995 .Os FreeBSD .Dt PPP 8 @@ -9,7 +9,8 @@ Point to Point Protocol (aka iijppp) .Sh SYNOPSIS .Nm -.Op Fl auto \*(Ba Fl direct Fl dedicated +.Op Fl auto | Fl direct | Fl dedicated +.Op Ar system .Sh DESCRIPTION This is a user process .Em PPP