Commit 3de1c713 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

secur32: Reap child process to avoid leaving a zombie.

parent 99797252
......@@ -28,7 +28,10 @@
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#endif
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#include <stdlib.h>
#include <fcntl.h>
#include "windef.h"
......@@ -276,7 +279,7 @@ void cleanup_helper(PNegoHelper helper)
{
TRACE("Killing helper %p\n", helper);
if( (helper == NULL) || (helper->helper_pid == 0))
if(helper == NULL)
return;
HeapFree(GetProcessHeap(), 0, helper->com_buf);
......@@ -285,6 +288,16 @@ void cleanup_helper(PNegoHelper helper)
close(helper->pipe_out);
close(helper->pipe_in);
#ifdef HAVE_FORK
if (helper->helper_pid > 0) /* reap child */
{
pid_t wret;
do {
wret = waitpid(helper->helper_pid, NULL, 0);
} while (wret < 0 && errno == EINTR);
}
#endif
HeapFree(GetProcessHeap(), 0, helper);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment