From a8b1379ccbfbe7f1d7732147c4969bb92499555d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 26 Oct 2009 21:38:18 +0000 Subject: Clear signal flags /before/ taking action and continue afterwards to reduce chance of dropping signals. Pointed out by deraadt@. --- client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 7959559b..a5c5e39e 100644 --- a/client.c +++ b/client.c @@ -185,17 +185,20 @@ client_main(void) client_write_server(MSG_EXITING, NULL, 0); } if (sigchld) { - waitpid(WAIT_ANY, NULL, WNOHANG); sigchld = 0; + waitpid(WAIT_ANY, NULL, WNOHANG); + continue; } if (sigwinch) { + sigwinch = 0; client_write_server(MSG_RESIZE, NULL, 0); - sigwinch = 0; + continue; } if (sigcont) { + sigcont = 0; siginit(); client_write_server(MSG_WAKEUP, NULL, 0); - sigcont = 0; + continue; } pfd.fd = client_ibuf.fd; -- cgit