summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2021-01-19 21:35:06 +0100
committerPhilipp Stephani <phst@google.com>2021-01-19 21:38:46 +0100
commit8ed97a8d543b9596166c670212265dabc44aa3d5 (patch)
tree4313a6fe56d6c139391f974be3597009fbfcdef3
parent8725f7690a44306f03d7cbb9eaa45590fcaf88db (diff)
downloademacs-8ed97a8d543b9596166c670212265dabc44aa3d5.tar.gz
Make child signal read pipe non-blocking.
Otherwise Emacs might hang when trying to read the pipe twice in a row. This is consistent with the other file descriptors we pass to 'pselect'. * src/process.c (child_signal_init): Make read end of pipe non-blocking.
-rw-r--r--src/process.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index 09f87908a45..57105982c15 100644
--- a/src/process.c
+++ b/src/process.c
@@ -7179,6 +7179,8 @@ child_signal_init (void)
exits. */
eassert (0 <= fds[0]);
eassert (0 <= fds[1]);
+ if (fcntl (fds[0], F_SETFL, O_NONBLOCK) != 0)
+ emacs_perror ("fcntl");
add_read_fd (fds[0], child_signal_read, NULL);
fd_callback_info[fds[0]].flags &= ~KEYBOARD_FD;
child_signal_read_fd = fds[0];