emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 312da48 2/2: Don't retry reading after receiving EINVAL


From: Lars Ingebrigtsen
Subject: master 312da48 2/2: Don't retry reading after receiving EINVAL
Date: Mon, 14 Sep 2020 09:19:04 -0400 (EDT)

branch: master
commit 312da4871925b9a575c5e3bffd4bf4db4c1108da
Author: Pip Cet <pipcet@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Don't retry reading after receiving EINVAL
    
    * src/process.c (wait_reading_process_output): Don't retry reading
    from an fd after an unknown error (bug#6074).
---
 src/process.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index 3aa105a..53f4a1d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5413,14 +5413,16 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
          /* If data can be read from the process, do so until exhausted.  */
          if (wait_proc->infd >= 0)
            {
+             unsigned int count = 0;
              XSETPROCESS (proc, wait_proc);
 
              while (true)
                {
                  int nread = read_process_output (proc, wait_proc->infd);
+                 rarely_quit (++count);
                  if (nread < 0)
                    {
-                     if (errno == EIO || would_block (errno))
+                     if (errno != EINTR)
                        break;
                    }
                  else



reply via email to

[Prev in Thread] Current Thread [Next in Thread]