*/
#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>
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));
}
/* 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;
}
-/*
- * 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.