summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-02-10 22:33:43 +0000
committerbrian <brian@FreeBSD.org>1998-02-10 22:33:43 +0000
commit78287d51b2b6d4a8f7fa3e7f1bc47f5806a5964f (patch)
tree2027f8782e800f5bc3e4bf3ebd1391b4222f6bf7 /usr.sbin/ppp/main.c
parent5eba76ed2e2216365302f3c5884a29bac2c11094 (diff)
downloadFreeBSD-src-78287d51b2b6d4a8f7fa3e7f1bc47f5806a5964f.zip
FreeBSD-src-78287d51b2b6d4a8f7fa3e7f1bc47f5806a5964f.tar.gz
Move handle_signals() to before the FD_SETs. handle_signals()
may result in a our modem closing after it's made its way into the fd_set, resulting in a program exit (with select(): bad file descriptor) rather than a dropped link.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 6418aca..3fef84a 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.120 1998/01/27 23:14:51 brian Exp $
+ * $Id: main.c,v 1.121 1998/01/29 00:42:05 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -885,6 +885,11 @@ DoLoop(void)
IpStartOutput();
qlen = ModemQlen();
}
+
+#ifdef SIGALRM
+ handle_signals();
+#endif
+
if (modem >= 0) {
if (modem + 1 > nfds)
nfds = modem + 1;
@@ -910,8 +915,6 @@ DoLoop(void)
*/
usleep(TICKUNIT);
TimerService();
-#else
- handle_signals();
#endif
/* If there are aren't many packets queued, look for some more. */
OpenPOWER on IntegriCloud