-static int child_check(void)
-{
- GSList *tmp, *next;
- int status;
-
- /* wait for each pid.. */
- for (tmp = pids; tmp != NULL; tmp = next) {
- int pid = GPOINTER_TO_INT(tmp->data);
-
- next = tmp->next;
- if (waitpid(pid, &status, WNOHANG) > 0) {
- /* process terminated, remove from list */
- signal_emit_id(signal_pidwait, 2, tmp->data,
- GINT_TO_POINTER(status));
- pids = g_slist_remove(pids, tmp->data);
- }
- }
- return 1;
-}
-