X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=4acc217d1661a9868da3a966c21ff380c6c71287;hb=050b89c40f0441d4445563043aae5ea1bd94bcc3;hp=a33a5e242188bfc6f0437ce0f448f58853e9750b;hpb=a4efaa63e68e25e712af030a138a272dfe0d2180;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index a33a5e2..4acc217 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: main.c,v 1.80 1999/07/21 00:24:31 paulus Exp $"; +static const char rcsid[] = "$Id: main.c,v 1.81 1999/08/12 04:17:07 paulus Exp $"; #endif #include @@ -87,6 +87,7 @@ struct stat devstat; /* result of stat() on devnam */ int prepass = 0; /* doing prepass to find device name */ int devnam_fixed; /* set while in options.ttyxx file */ volatile int status; /* exit status for pppd */ +int unsuccess; /* # unsuccessful connection attempts */ static int fd_ppp = -1; /* fd for talking PPP */ static int fd_loop; /* fd for getting demand-dial packets */ @@ -498,6 +499,7 @@ main(argc, argv) ttyfd = -1; real_ttyfd = -1; status = EXIT_OK; + ++unsuccess; if (demand) { /* @@ -856,7 +858,7 @@ main(argc, argv) pidfilename[0] = 0; } - if (!persist) + if (!persist || (maxfail > 0 && unsuccess >= maxfail)) break; kill_link = 0;