Esempio n. 1
0
void
wwchild()
{
	extern errno;
	int olderrno;
	register struct ww **wp;
	union wait w;
	int pid;
	char collected = 0;

	olderrno = errno;
	while ((pid =
	    wait3((int *)&w, WNOHANG|WUNTRACED, (struct rusage *)0)) > 0) {
		for (wp = wwindex; wp < &wwindex[NWW]; wp++) {
			if (*wp && (*wp)->ww_state == WWS_HASPROC
			    && (*wp)->ww_pid == pid) {
				(*wp)->ww_state = WWS_DEAD;
				collected = 1;
				break;
			}
		}
	}
	errno = olderrno;
	/* jump out of wwiomux when somebody dies */
	if (collected)
		wwsetintr();
}
Esempio n. 2
0
void
wwchild(int dummy __unused)
{
    int olderrno;
    struct ww **wp;
    int status;
    int pid;
    char collected = 0;

    olderrno = errno;
    while ((pid =
                wait3(&status, WNOHANG|WUNTRACED, (struct rusage *)0)) > 0) {
        for (wp = wwindex; wp < &wwindex[NWW]; wp++) {
            if (*wp && (*wp)->ww_state == WWS_HASPROC
                    && (*wp)->ww_pid == pid) {
                (*wp)->ww_state = WWS_DEAD;
                collected = 1;
                break;
            }
        }
    }
    errno = olderrno;
    /* jump out of wwiomux when somebody dies */
    if (collected)
        wwsetintr();
}