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

Re: PATCH: bug fix: infinite loop in sysread



On Wed, Feb 5, 2020 at 6:20 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> Here select() keeps returning 0, indicating timeout. This is not an
> error, so errno doesn't get set. If it was EINTR prior to the call,
> it stays EINTR, and the loop keeps spinning.
>
> The fix is to replace `< 1` with `< 0` in the loop condition.

Wouldn't a better fix be to set errno = 0 before the call?



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