From 30cf7371f3b044f183fcef73aaa10afcbddec886 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 1 May 2016 17:46:40 +0200 Subject: [PATCH] Unix Plink: Set O_NONBLOCK on the SIGWINCH pipe. This should avoid the possibility of the SIGWINCH handler's blocking when trying to write to the pipe. This could only happen if we'd somehow received PIPE_BUF SIGWINCHes without reading the pipe, which would be difficult to achieve. While we're at it, also set O_NONBLOCK on the reading side of the pipe, just in case. --- unix/uxplink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unix/uxplink.c b/unix/uxplink.c index 7721e4b6..c3a1b8ca 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -946,6 +946,9 @@ int main(int argc, char **argv) perror("pipe"); exit(1); } + /* We don't want the signal handler to block if the pipe's full. */ + nonblock(signalpipe[0]); + nonblock(signalpipe[1]); putty_signal(SIGWINCH, sigwinch); /* -- 2.45.2