mirror of https://github.com/neutrinolabs/xrdp
Merge pull request #2151 from zbstao/devel
Fixed possible infinite loop (regression on #2146)
This commit is contained in:
commit
df23c01c37
|
@ -2973,7 +2973,7 @@ g_waitchild(void)
|
|||
|
||||
/*****************************************************************************/
|
||||
/* does not work in win32
|
||||
returns pid of process that exits or zero if signal occurred */
|
||||
returns pid of process that exits or <= 0 if no process was found */
|
||||
int
|
||||
g_waitpid(int pid)
|
||||
{
|
||||
|
@ -2989,14 +2989,6 @@ g_waitpid(int pid)
|
|||
else
|
||||
{
|
||||
rv = waitpid(pid, 0, 0);
|
||||
|
||||
if (rv == -1)
|
||||
{
|
||||
if (errno == EINTR) /* signal occurred */
|
||||
{
|
||||
rv = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -131,7 +131,7 @@ sig_sesman_session_end(int sig)
|
|||
session_kill(pid);
|
||||
}
|
||||
}
|
||||
while (pid >= 0);
|
||||
while (pid > 0);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -163,7 +163,7 @@ xrdp_shutdown(int sig)
|
|||
static void
|
||||
xrdp_child(int sig)
|
||||
{
|
||||
while (g_waitchild() >= 0)
|
||||
while (g_waitchild() > 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue