Closed
Description
When starting a child process on Windows then rust_run_program.cpp
casts a process HANDLE
to int
and then core::run
pretends that it is really a process id (a pid_t
).
This is bad because (on Windows):
- The
HANDLE
never gets closed (it leaks). - It means calling
core::os::waitpid
orcore::run::waitpid
with apid_t
that wasn't retrieved fromrust_run_program
will result in undefined behaviour. - it means that calling
core::run::Program.get_id
returns a value that isn't really the process id.
I will send a pull request to address these issues, unless there are objections.