1) Open /dev/null for std* after setsid() to be shure that modem is

*not* our controlling terminal (SIGHUP can coming in other case)

2) Add HUPCL for non-dedicated lines to be shure that modem
properly resetted.

3) Correct usage string.
This commit is contained in:
Andrey A. Chernov 1996-03-09 08:18:41 +00:00
parent c146b42dc0
commit d91680ea37
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14436
4 changed files with 21 additions and 6 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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