Fixed possible SIGCHILD signal lost
When multiple(eg. 20) xrdp connections are disconnected at the same time(eg. close all rdp client at the same time), zombie process may be spawned.
This commit is contained in:
parent
a13742f097
commit
35d400a899
12
sesman/sig.c
12
sesman/sig.c
@ -122,12 +122,16 @@ sig_sesman_session_end(int sig)
|
||||
return;
|
||||
}
|
||||
|
||||
pid = g_waitchild();
|
||||
|
||||
if (pid > 0)
|
||||
do
|
||||
{
|
||||
session_kill(pid);
|
||||
pid = g_waitchild();
|
||||
|
||||
if (pid > 0)
|
||||
{
|
||||
session_kill(pid);
|
||||
}
|
||||
}
|
||||
while (pid >= 0);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -163,9 +163,7 @@ xrdp_shutdown(int sig)
|
||||
static void
|
||||
xrdp_child(int sig)
|
||||
{
|
||||
int safety;
|
||||
|
||||
for (safety = 0; (g_waitchild() >= 0) && (safety <= 10); safety++)
|
||||
while (g_waitchild() >= 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user