summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-04-13 00:54:45 +0000
committerbrian <brian@FreeBSD.org>1997-04-13 00:54:45 +0000
commitb2533fba6ff7273bd2dbe3373b345e5b53d48f0b (patch)
treee29f55118a8b9569505404706851431843ee96d2 /usr.sbin/ppp/main.c
parent24892f810362b61662c5846a03a44ac143eb4f44 (diff)
downloadFreeBSD-src-b2533fba6ff7273bd2dbe3373b345e5b53d48f0b.zip
FreeBSD-src-b2533fba6ff7273bd2dbe3373b345e5b53d48f0b.tar.gz
Make -background option attempt each phone number at most
once. Make -background ignore redial. Output exit value to syslog with "PPP Terminated" message.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 6f43044..04a5d26 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.41 1997/04/09 17:35:54 ache Exp $
+ * $Id: main.c,v 1.42 1997/04/12 22:58:39 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -172,7 +172,7 @@ int excode;
LogPrintf(LOG_PHASE_BIT,"Failed to notify parent of failure.\n");
close(BGFiledes[1]);
}
- LogPrintf(LOG_PHASE_BIT, "PPP Terminated.\n");
+ LogPrintf(LOG_PHASE_BIT, "PPP Terminated %d.\n",excode);
LogClose();
if (server >= 0) {
close(server);
@@ -775,7 +775,12 @@ DoLoop()
tries = 0;
} else {
CloseModem();
- if (VarDialTries && tries >= VarDialTries) {
+ if (mode & MODE_BACKGROUND) {
+ if (VarNextPhone == NULL)
+ Cleanup(EX_DIAL); /* Tried all numbers - no luck */
+ else
+ sleep(1); /* Try all numbers in background mode */
+ } else if (VarDialTries && tries >= VarDialTries) {
/* I give up ! Can't get through :( */
StartRedialTimer();
dial_up = FALSE;
OpenPOWER on IntegriCloud