1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Build pid_filename without a double slash.

Make ``Dial attempt'' diagnostics consistent.

Reset lostCarrier when it has reached max.
Suggested by:	Kevin Street <street@iName.com>
This commit is contained in:
Brian Somers 1997-05-14 01:18:51 +00:00
parent ce72881634
commit 298091dacd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25801
2 changed files with 11 additions and 7 deletions

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: command.c,v 1.44 1997/05/10 03:39:51 brian Exp $
* $Id: command.c,v 1.45 1997/05/10 23:46:29 ache Exp $
*
*/
#include <sys/types.h>
@ -143,7 +143,7 @@ char **argv;
}
tries = 0;
do {
printf("Dial attempt %u\n", ++tries);
printf("Dial attempt %u of %d\n", ++tries, VarDialTries);
modem = OpenModem(mode);
if (modem < 0) {
printf("failed to open modem.\n");

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.48 1997/05/10 03:39:53 brian Exp $
* $Id: main.c,v 1.49 1997/05/11 10:23:16 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@ -460,7 +460,7 @@ char **argv;
close(BGFiledes[0]);
}
snprintf(pid_filename, sizeof (pid_filename), "%s/tun%d.pid",
snprintf(pid_filename, sizeof (pid_filename), "%stun%d.pid",
_PATH_VARRUN, tunno);
(void)unlink(pid_filename);
@ -768,13 +768,17 @@ DoLoop()
* due to the "set reconnect" value, we'd better bring the line
* back up now.
*/
if (LcpFsm.state <= ST_CLOSED && dial_up != TRUE
&& lostCarrier && lostCarrier <= VarReconnectTries) {
if (LcpFsm.state <= ST_CLOSED && dial_up != TRUE && lostCarrier)
if (lostCarrier <= VarReconnectTries) {
LogPrintf(LOG_PHASE_BIT, "Connection lost, re-establish (%d/%d)\n",
lostCarrier, VarReconnectTries);
StartRedialTimer(VarReconnectTimer);
dial_up = TRUE;
}
} else {
LogPrintf(LOG_PHASE_BIT, "Connection lost, maximum (%d) times\n",
VarReconnectTries);
lostCarrier = 0;
}
/*
* If Ip packet for output is enqueued and require dial up,