From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0f964ee9 for ; Wed, 5 Feb 2020 20:56:33 +0000 (UTC) Received: (qmail 27483 invoked by alias); 5 Feb 2020 20:56:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45383 Received: (qmail 5852 invoked by uid 1010); 5 Feb 2020 20:56:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25713. spamassassin: 3.4.2. Clear:RC:0(209.85.167.51):SA:0(-1.9/5.0):. Processed in 1.663317 secs); 05 Feb 2020 20:56:25 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.51 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pgbxqLKkucKrEoH6t3pBb4sg4DGk+pVXCRnuUfX7iD8=; b=oB8ODZZ+HZxd8b3jy2cd6T3pifXFVP/NuUlbMSVwOvW0jF3cEBNOivX7u8+KBjMJHu EV8/s5190ZrKmE6gcGVgf8G9PlfZFr5nTcFfaTjrjJV9qaxqDTFCny0pdQMYQsPVZRIY qWXKFBqmd1j4xQ0+fMHDVornmrFpCj8JxHlYct4PnRNhdaix5I8t/Vevby8SJTklOrMN N3aa5vPzW60w0dXoBHlZKht3NzOWhStxOGu3mxw9dY0/zDPol9dWduzEZ6l5lc+023dj /PfkOWQh+DCJS09qsUukskQePbNqL+6hu9LuPqtpPv/CnlMByerRKeYxqEDwPAQS6Py6 TW1w== X-Gm-Message-State: APjAAAUJYBzlvDv4tFkOpT7MLytr+2brFRaY9SYhqtLlY94Eqyk4XuEq +Lw67V4+sNwa3GrTNTKzROoPWBD9M5YrWnarystYlA== X-Google-Smtp-Source: APXvYqxXo4FgKfTL6J2PsqnYEQPpLjNr8n/YHW5UPJPAVE6iM6jE7xgd//Pfg5dQR1WvmNqWAHFQjExTt8p96QPWF/4= X-Received: by 2002:ac2:4c2b:: with SMTP id u11mr18904115lfq.46.1580936148720; Wed, 05 Feb 2020 12:55:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 5 Feb 2020 12:55:37 -0800 Message-ID: Subject: Re: PATCH: bug fix: infinite loop in sysread To: Roman Perepelitsa Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Wed, Feb 5, 2020 at 6:20 AM Roman Perepelitsa 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?