]> git.ozlabs.org Git - ppp.git/commitdiff
add debugging messages about waiting for children at exit
authorPaul Mackerras <paulus@samba.org>
Mon, 12 Apr 1999 06:44:42 +0000 (06:44 +0000)
committerPaul Mackerras <paulus@samba.org>
Mon, 12 Apr 1999 06:44:42 +0000 (06:44 +0000)
pppd/main.c

index 8fab86467254d267c36fb40559eced0baeaada5a..31828a788f48ae0960d00e3b594303876993ca4f 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.74 1999/04/12 06:24:46 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.75 1999/04/12 06:44:42 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -126,6 +126,20 @@ int link_stats_valid;
 
 static int charshunt_pid;      /* Process ID for charshunt */
 
+/*
+ * We maintain a list of child process pids and
+ * functions to call when they exit.
+ */
+struct subprocess {
+    pid_t      pid;
+    char       *prog;
+    void       (*done) __P((void *));
+    void       *arg;
+    struct subprocess *next;
+};
+
+static struct subprocess *children;
+
 /* Prototypes for procedures local to this file. */
 
 static void create_pidfile __P((void));
@@ -809,8 +823,15 @@ main(argc, argv)
     }
 
     /* Wait for scripts to finish */
-    while (n_children > 0)
+    while (n_children > 0) {
+       if (debug) {
+           struct subprocess *chp;
+           dbglog("Waiting for %d child processes...", n_children);
+           for (chp = children; chp != NULL; chp = chp->next)
+               dbglog("  script %s, pid %d", chp->prog, chp->pid);
+       }
        reap_kids(1);
+    }
 
     die(0);
     return 0;
@@ -1382,20 +1403,6 @@ device_script(program, in, out, dont_wait)
 }
 
 
-/*
- * We maintain a list of child process pids and
- * functions to call when they exit.
- */
-struct subprocess {
-    pid_t      pid;
-    char       *prog;
-    void       (*done) __P((void *));
-    void       *arg;
-    struct subprocess *next;
-};
-
-struct subprocess *children;
-
 /*
  * run-program - execute a program with given arguments,
  * but don't wait for it.