Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: ignore EINTR in ztcp/zsocket accept()



On Mon, 10 Aug 2015 14:18:59 +0200
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Joshua Krusell wrote:
> > -	{
> > +	do {
> > +	    rfd = accept(lfd, (struct sockaddr *)&soun, &len);
> > +	} while (errno == EINTR && !errflag);
> 
> On success, errno is not set to zero. So if it happens to have a stray
> value of EINTR before the loop, this could loop despite accept having
> succeeded. Shouldn't rfd == -1 also be included in the condition?

Yes, you're right.

pws



Messages sorted by: Reverse Date, Date, Thread, Author