summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-28 23:11:07 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-28 23:11:07 +0000
commite65aa04ad780b76c3356d281677bb7a71c89cda3 (patch)
tree3111c99ec206282e6b34a4ce397332f8b6e8f1e1
parentd0afc47bfb55ad1d5950b0a316870106ec33a2f6 (diff)
Sync OpenBSD patchset 466:
Clear signal flags /before/ taking action and continue afterwards to reduce chance of dropping signals. Pointed out by deraadt@.
-rw-r--r--client.c11
-rw-r--r--server.c8
2 files changed, 12 insertions, 7 deletions
diff --git a/client.c b/client.c
index af7f82c6..7368e767 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.81 2009-10-23 17:38:42 tcunha Exp $ */
+/* $Id: client.c,v 1.82 2009-10-28 23:11:07 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -189,17 +189,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;
diff --git a/server.c b/server.c
index c2daaf59..c1ed7312 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.211 2009-10-23 17:49:47 tcunha Exp $ */
+/* $Id: server.c,v 1.212 2009-10-28 23:11:07 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -331,15 +331,17 @@ server_main(int srv_fd)
/* Handle child exit. */
if (sigchld) {
- server_child_signal();
sigchld = 0;
+ server_child_signal();
+ continue;
}
/* Recreate socket on SIGUSR1. */
if (sigusr1) {
+ sigusr1 = 0;
close(srv_fd);
srv_fd = server_create_socket();
- sigusr1 = 0;
+ continue;
}
/* Initialise pollfd array and add server socket. */