Commit abe6a13f authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

libwine: Reap child process to avoid leaving a zombie.

parent 3de1c713
...@@ -101,7 +101,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags, ...@@ -101,7 +101,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
{ {
char * volatile result = NULL; char * volatile result = NULL;
int pagesize = getpagesize(); int pagesize = getpagesize();
pid_t pid; pid_t pid, wret;
/* We only try to map to a fixed address if /* We only try to map to a fixed address if
addr is non-NULL and properly aligned, addr is non-NULL and properly aligned,
...@@ -150,9 +150,10 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags, ...@@ -150,9 +150,10 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
_exit(1); _exit(1);
} }
/* vfork() lets the parent continue only after the child /* reap child */
has exited. Furthermore, Wine sets SIGCHLD to SIG_IGN, do {
so we don't need to wait for the child. */ wret = waitpid(pid, NULL, 0);
} while (wret < 0 && errno == EINTR);
return result == addr; return result == addr;
} }
......
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