summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2021-01-10 17:59:29 +0100
committerPhilipp Stephani <phst@google.com>2021-01-10 17:59:29 +0100
commit94ada232b1515771a8ec4dc62483c42b6cdbc3a0 (patch)
tree2d25ebc774f816ae78b1278534f9aab505e11266
parentad830e5f33df393fb5bd54a58b796ed2c5f59fcb (diff)
downloademacs-scratch/sigchld-fd.tar.gz
Don't crash if no asynchronous process has been created yet.scratch/sigchld-fd
* src/process.c (wait_reading_process_output): Allow child_signal_read_fd < 0.
-rw-r--r--src/process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index 474c87089e0..aca87f8ed35 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