Re: [PATCH v2 06/14] mingw: use real pid
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Jan 15, 2010, 22:53 UTC
- Message-ID
- <40aa078e1001151453i3576a345k217944c38887b61f@mail.gmail.com>
- In-Reply-To
- <201001152330.06083.j6t@kdbg.org>
On Fri, Jan 15, 2010 at 11:30 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 11 quoted lines
> On Freitag, 15. Januar 2010, Erik Faye-Lund wrote: >> @@ -729,7 +729,7 @@ static pid_t mingw_spawnve(const char *cmd, const char >> **argv, char **env, return -1; >> } >> CloseHandle(pi.hThread); >> - return (pid_t)pi.hProcess; >> + return (pid_t)pi.dwProcessId; >> } > > You are not using the pi.hProcess anymore, so you must close it. >
No. If I do, the pid becomes invalid after the process is finished, and waitpid won't work. I couldn't find anywhere were we actually were closing the handle, even after it was finished. So I don't think we leak any more than we already did (for non-daemon purposes).
-- Erik "kusma" Faye-Lund