Cleaned up code.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@480 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-16 20:18:05 +00:00 committed by cras
commit c2397475c5
24 changed files with 489 additions and 363 deletions

View file

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