summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-03-09 08:18:41 +0000
committerache <ache@FreeBSD.org>1996-03-09 08:18:41 +0000
commitf785271ddafea2eb75061d9de1d5b5bac3f48fb2 (patch)
tree47e0d9bc793b15289143d3acd7d90353b1d8cce8 /usr.sbin/ppp/main.c
parenteecb8eb3ab4d2ee26642bae8c0a4fef5a339b7d7 (diff)
downloadFreeBSD-src-f785271ddafea2eb75061d9de1d5b5bac3f48fb2.zip
FreeBSD-src-f785271ddafea2eb75061d9de1d5b5bac3f48fb2.tar.gz
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.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 87f9740..f80b6b2 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;
OpenPOWER on IntegriCloud