summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-26 21:38:18 +0000
committernicm <nicm@openbsd.org>2009-10-26 21:38:18 +0000
commit95e5c094875d8d13070116cce31ce6527aad5041 (patch)
tree405805419747ef6503c109b09e252444e60d6abd /usr.bin/tmux/client.c
parentCall fstat() after fopen() rather than stat() before. (diff)
downloadwireguard-openbsd-95e5c094875d8d13070116cce31ce6527aad5041.tar.xz
wireguard-openbsd-95e5c094875d8d13070116cce31ce6527aad5041.zip
Clear signal flags /before/ taking action and continue afterwards to reduce
chance of dropping signals. Pointed out by deraadt@.
Diffstat (limited to 'usr.bin/tmux/client.c')
-rw-r--r--usr.bin/tmux/client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index 7be092bc935..32afa8c4bd6 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.26 2009/10/21 21:11:55 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.27 2009/10/26 21:38:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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;