From aeff424c555da7e80775482db84eecef10286fc3 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sat, 23 Jan 2021 17:24:34 +0100 Subject: [PATCH] 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 697d9b0b19b..9b1de19f0ae 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]; -- 2.39.2