… | |
… | |
423 | struct ev_child *w; |
423 | struct ev_child *w; |
424 | int pid, status; |
424 | int pid, status; |
425 | |
425 | |
426 | while ((pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED)) != -1) |
426 | while ((pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED)) != -1) |
427 | for (w = childs [pid & (PID_HASHSIZE - 1)]; w; w = w->next) |
427 | for (w = childs [pid & (PID_HASHSIZE - 1)]; w; w = w->next) |
428 | if (w->pid == pid || w->pid == -1) |
428 | if (w->pid == pid || !w->pid) |
429 | { |
429 | { |
430 | w->status = status; |
430 | w->status = status; |
431 | event ((W)w, EV_CHILD); |
431 | event ((W)w, EV_CHILD); |
432 | } |
432 | } |
433 | } |
433 | } |