mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +00:00
(trunk, libT) #5452 'preventing zombies from child scripts' -- fixed.
This commit is contained in:
parent
76528d8e14
commit
6fc8481524
1 changed files with 12 additions and 2 deletions
|
@ -17,7 +17,6 @@
|
|||
#include <sys/wait.h> /* wait () */
|
||||
#else
|
||||
#include <process.h>
|
||||
#define waitpid(pid, status, options) _cwait (status, pid, WAIT_CHILD)
|
||||
#endif
|
||||
#include <unistd.h> /* stat */
|
||||
#include <dirent.h>
|
||||
|
@ -2073,7 +2072,18 @@ tr_torrentClearIdleLimitHitCallback (tr_torrent * torrent)
|
|||
static void
|
||||
onSigCHLD (int i UNUSED)
|
||||
{
|
||||
waitpid (-1, NULL, WNOHANG);
|
||||
#ifdef WIN32
|
||||
|
||||
_cwait (NULL, -1, WAIT_CHILD);
|
||||
|
||||
#else
|
||||
|
||||
int rc;
|
||||
do
|
||||
rc = waitpid (-1, NULL, WNOHANG);
|
||||
while (rc>0 || (rc==-1 && errno==EINTR));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue