mirror of
https://github.com/tmate-io/tmate.git
synced 2024-12-26 08:38:51 +01:00
Call waitpid on SIGCHLD even if client not attached, it is possible (on
very slow platforms) for the first daemon() child to still be running when client_attached is set so we end up with a zombie. From J Raynor.
This commit is contained in:
parent
a54b0055f6
commit
045d0c3b9f
10
client.c
10
client.c
@ -433,15 +433,11 @@ client_signal(int sig, unused short events, unused void *data)
|
|||||||
struct sigaction sigact;
|
struct sigaction sigact;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (!client_attached) {
|
if (sig == SIGCHLD)
|
||||||
switch (sig) {
|
|
||||||
case SIGCHLD:
|
|
||||||
waitpid(WAIT_ANY, &status, WNOHANG);
|
waitpid(WAIT_ANY, &status, WNOHANG);
|
||||||
break;
|
else if (!client_attached) {
|
||||||
case SIGTERM:
|
if (sig == SIGTERM)
|
||||||
event_loopexit(NULL);
|
event_loopexit(NULL);
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
switch (sig) {
|
switch (sig) {
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
|
Loading…
Reference in New Issue
Block a user