struct pipe_params *p, *n;
struct connection *n;
void cleanup_children(void){	struct pipe_params *p, *n;	p = busy_pipes.head;	while (p) {		n = p->next;		if (p->cn == 0) {			log_d("cleaning up orphan pipe");			close_child(p, -1);		} else {			if (p->error_condition) {				if (p->error_condition == STUB_ERROR_RESTART)					close_child(p, cgi_error(p->cn->r) == -1 ? HC_CLOSING : HC_WRITING);				else					close_child(p, HC_CLOSING);			} else if (current_time >= p->t + (time_t) tuning.script_timeout) {				log_d("script timeout to %s[%hu]", inet_ntoa(p->cn->peer.sin_addr), ntohs(p->cn->peer.sin_port));				close_child(p, HC_CLOSING);			} else if (childisfinished(p))				close_child(p, p->cn->keepalive ? HC_REINIT : HC_CLOSING);		}		p = n;	}}