]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Unix Plink: Set O_NONBLOCK on the SIGWINCH pipe.
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 1 May 2016 15:46:40 +0000 (17:46 +0200)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 1 May 2016 16:13:03 +0000 (18:13 +0200)
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

index 7721e4b673349180b1e3767a78323db23e18fd4b..c3a1b8ca8886c75fa3ce527cfb922921e4b18d34 100644 (file)
@@ -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);
 
     /*