Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: bug fix: infinite loop in sysread
- X-seq: zsh-workers 45383
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: PATCH: bug fix: infinite loop in sysread
- Date: Wed, 5 Feb 2020 12:55:37 -0800
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAN=4vMqkV3uf3Ki4221k_HpYaqNmTq_msD7kv_Eg-5rg5=MDhA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMqkV3uf3Ki4221k_HpYaqNmTq_msD7kv_Eg-5rg5=MDhA@mail.gmail.com>
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