if (debug) log_d("readfromchild: fd=%d, ipp=%d, bytestoread=%d, r=%d", p->pfd, p->ipp, bytestoread, r); 
static int readfromchild(struct pipe_params *p){	size_t bytestoread;	ssize_t r;	bytestoread = p->psize - p->ipp;	if (p->haslen && bytestoread > p->pmax)		bytestoread = p->pmax;	if (bytestoread == 0) {		log_d("readfromchild: bytestoread is zero!");		p->error_condition = STUB_ERROR_PIPE;		return -1;	}	r = recv(p->pfd, p->pbuf + p->ipp, bytestoread, 0);	switch (r) {	case -1:		switch (errno) {		default:			lerror("readfromchild");		case ECONNRESET:		case EPIPE:			p->error_condition = STUB_ERROR_PIPE;			return -1;		case EAGAIN:			break;		}		break;	case 0:		if (p->state != 2) {			log_d("readfromchild: premature end of script headers");			p->error_condition = STUB_ERROR_RESTART;			return -1;		}		if (p->haslen) {			log_d("readfromchild: script went away (pmax=%d)", p->pmax);			p->error_condition = STUB_ERROR_PIPE;			return -1;		}		p->t = current_time;		p->pstate = 2;		break;	default:		p->t = current_time;		p->ipp += r;		if (p->haslen) {			p->pmax -= r;			if (p->pmax == 0)				p->pstate = 2;		}		break;	}	return 0;}
8520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8520/0d2de3757323e5412cd086058af8f3169307b579/stub.c/buggy/src/stub.c