]> git.ozlabs.org Git - ppp.git/commitdiff
When not in demand mode, defer create_linkpidfile() until we successfully
authorFrank Cusack <fcusack@fcusack.com>
Mon, 12 May 2003 07:31:36 +0000 (07:31 +0000)
committerFrank Cusack <fcusack@fcusack.com>
Mon, 12 May 2003 07:31:36 +0000 (07:31 +0000)
get a ppp interface.  This fixes a bug reported by belle_eden@caramail.com
where pppd might wipe out a still-running previous pppd's pid file.

pppd/main.c

index d92fdeb2142b18af6ef2c78e2b6351103d968bea..8511503f78aa8296ac839df7728bb161542d82c7 100644 (file)
@@ -40,7 +40,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: main.c,v 1.126 2003/04/07 00:01:45 paulus Exp $"
+#define RCSID  "$Id: main.c,v 1.127 2003/05/12 07:31:36 fcusack Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
@@ -438,8 +438,6 @@ main(argc, argv)
 
     waiting = 0;
 
-    create_linkpidfile(getpid());
-
     /*
      * If we're doing dial-on-demand, set up the interface now.
      */
@@ -459,6 +457,7 @@ main(argc, argv)
         * Configure the interface and mark it up, etc.
         */
        demand_conf();
+       create_linkpidfile(getpid());
     }
 
     do_callback = 0;
@@ -515,6 +514,9 @@ main(argc, argv)
            status = EXIT_FATAL_ERROR;
            goto disconnect;
        }
+       /* create the pid file, now that we've obtained a ppp interface */
+       if (!demand)
+           create_linkpidfile(getpid());
 
        if (!demand && ifunit >= 0)
            set_ifunit(1);