summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1998-02-11 19:45:04 +0000
committerbrian <brian@cvs.openbsd.org>1998-02-11 19:45:04 +0000
commitc84066f26bc08764e62111a6de3a9766d490a77e (patch)
tree4e0913aefec8a1e4cee98d11e75895b46402167a /usr.sbin/ppp
parent439942d7f1bda7d8ff87f8910c0436e7a412f2c5 (diff)
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')
-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 e0672ed03eb..ac2bb15af0c 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.17 1998/01/29 00:35:33 brian Exp $
+ * $Id: main.c,v 1.18 1998/02/11 19:45:03 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. */