diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-11-27 21:26:43 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-11-27 21:26:43 +0800 |
commit | ee353847be7b98de6d2a989f3522b5bd989261e4 (patch) | |
tree | f7e3c351e5999732528d462fc8743042a5cff950 /common-session.c | |
parent | 33b2fbb5ef77bb8d31d0a4f9de3c4175da219b71 (diff) |
Fix ses.channel_signal_pending race
Diffstat (limited to 'common-session.c')
-rw-r--r-- | common-session.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common-session.c b/common-session.c index 96d747d..874d539 100644 --- a/common-session.c +++ b/common-session.c @@ -162,6 +162,7 @@ void session_loop(void(*loophandler)()) { /* We get woken up when signal handlers write to this pipe. SIGCHLD in svr-chansession is the only one currently. */ FD_SET(ses.signal_pipe[0], &readfd); + ses.channel_signal_pending = 0; /* set up for channels which can be read/written */ setchannelfds(&readfd, &writefd, writequeue_has_space); @@ -211,7 +212,9 @@ void session_loop(void(*loophandler)()) { wake up the select() above. */ if (FD_ISSET(ses.signal_pipe[0], &readfd)) { char x; + TRACE(("signal pipe set")) while (read(ses.signal_pipe[0], &x, 1) > 0) {} + ses.channel_signal_pending = 1; } /* check for auth timeout, rekeying required etc */ |