emacs-diffs
[Top][All Lists]
Advanced

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

master aeff424: Mark both ends of self-pipe a nonblocking.


From: Philipp Stephani
Subject: master aeff424: Mark both ends of self-pipe a nonblocking.
Date: Sat, 23 Jan 2021 11:27:43 -0500 (EST)

branch: master
commit aeff424c555da7e80775482db84eecef10286fc3
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Mark both ends of self-pipe a nonblocking.
    
    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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/process.c b/src/process.c
index 697d9b0..9b1de19 100644
--- a/src/process.c
+++ b/src/process.c
@@ -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];



reply via email to

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