emacs-diffs
[Top][All Lists]
Advanced

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

scratch/sigchld-fd 94ada23: Don't crash if no asynchronous process has b


From: Philipp Stephani
Subject: scratch/sigchld-fd 94ada23: Don't crash if no asynchronous process has been created yet.
Date: Sun, 10 Jan 2021 12:02:08 -0500 (EST)

branch: scratch/sigchld-fd
commit 94ada232b1515771a8ec4dc62483c42b6cdbc3a0
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Don't crash if no asynchronous process has been created yet.
    
    * src/process.c (wait_reading_process_output): Allow
    child_signal_read_fd < 0.
---
 src/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/process.c b/src/process.c
index 474c870..aca87f8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5413,9 +5413,9 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
         an asynchronous process.  Otherwise this might deadlock if we
         receive a SIGCHLD during `pselect'.  */
       int child_fd = child_signal_read_fd;
-      eassert (0 <= child_fd);
       eassert (child_fd < FD_SETSIZE);
-      FD_SET (child_fd, &Available);
+      if (0 <= child_fd)
+        FD_SET (child_fd, &Available);
 
       /* If frame size has changed or the window is newly mapped,
         redisplay now, before we start to wait.  There is a race



reply via email to

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