]> git.eshelyaron.com Git - emacs.git/commitdiff
Mark both ends of self-pipe a nonblocking.
authorPhilipp Stephani <phst@google.com>
Sat, 23 Jan 2021 16:24:34 +0000 (17:24 +0100)
committerPhilipp Stephani <phst@google.com>
Sat, 23 Jan 2021 16:26:49 +0000 (17:26 +0100)
While no deadlocks caused by the blocking write end have been reported
yet, marking both ends nonblocking is consistent and also recommended
in the GNU/Linux manpage of 'select'.

* src/process.c (child_signal_init): Mark write end of self-pipe as
nonblocking.

src/process.c

index 697d9b0b19b3b72af528e1d04a87a15b0f58c52c..9b1de19f0ae3782a21ee9407bdd1c36003a41e66 100644 (file)
@@ -7195,6 +7195,8 @@ child_signal_init (void)
   eassert (0 <= fds[1]);
   if (fcntl (fds[0], F_SETFL, O_NONBLOCK) != 0)
     emacs_perror ("fcntl");
+  if (fcntl (fds[1], 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];