aboutsummaryrefslogtreecommitdiffstats
path: root/src/ppp-watch.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-12-12 07:37:48 +0000
committerBill Nottingham <notting@redhat.com>2000-12-12 07:37:48 +0000
commit6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5 (patch)
treee1d7061544432640720d9f9bf1d56975dfdd5edc /src/ppp-watch.c
parent7598f8cb5a31d96c26090cadda678c1ea1a5dc37 (diff)
downloadinitscripts-6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5.tar
initscripts-6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5.tar.gz
initscripts-6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5.tar.bz2
initscripts-6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5.tar.xz
initscripts-6cdbc1fbbfd1de615402e1ddcc1dbb1590b69dd5.zip
add MAXFAIL patch for maximum number of failures (#10639)
Diffstat (limited to 'src/ppp-watch.c')
-rw-r--r--src/ppp-watch.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/ppp-watch.c b/src/ppp-watch.c
index a264dd90..2a7e53e4 100644
--- a/src/ppp-watch.c
+++ b/src/ppp-watch.c
@@ -85,6 +85,9 @@ static int theSigio = 0;
static int theSigchld = 0;
static int theSigalrm = 0;
+// patch to respect the maxfail parameter to ppp
+// Scott Sharkey <ssharkey@linux-no-limits.com>
+static int dialCount = 0;
static int theChild;
@@ -454,6 +457,7 @@ main(int argc, char **argv) {
int dieing = 0;
int sendsig;
int connectedOnce = 0;
+ int maxfail = 0; // MAXFAIL Patch <ssharkey@linux-no-limits.com>
if (argc < 2) {
fprintf (stderr, "usage: ppp-watch [ifcfg-]<logical-name> [boot]\n");
@@ -636,7 +640,25 @@ main(int argc, char **argv) {
tv.tv_sec = timeout;
select(0, NULL, NULL, NULL, &tv);
}
- fork_exec(0, "/etc/sysconfig/network-scripts/ifup-ppp", "daemon", device, theBoot);
+// Scott Sharkey <ssharkey@linux-no-limits.com>
+// MAXFAIL Patch...
+ temp = svGetValue(ifcfg, "MAXFAIL");
+ if (temp) {
+ maxfail = atoi(temp);
+ free(temp);
+ } else {
+ maxfail = 0;
+ }
+ if ( maxfail != 0 ) {
+ dialCount++;
+ if ( dialCount < maxfail ) {
+ fork_exec(0, "/etc/sysconfig/network-scripts/ifup-ppp", "daemon", device, theBoot);
+ } else {
+ cleanExit(WEXITSTATUS(status));
+ }
+ } else {
+ fork_exec(0, "/etc/sysconfig/network-scripts/ifup-ppp", "daemon", device, theBoot);
+ }
} else {
cleanExit(WEXITSTATUS(status));
}