rust/src/libstd/sys
Alex Crichton c1149edf7a std: Fix inheriting standard handles on windows
Currently if a standard I/O handle is set to inherited on Windows, no action is
taken and the slot in the process information description is set to
`INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however,
this means that the handle is actually set to nothing and if a child tries to
print it will generate an error.

This commit fixes this behavior by explicitly creating stdio handles to be
placed in these slots by duplicating the current process's I/O handles. This is
presumably what previously happened silently by using a file-descriptor-based
implementation instead of a `HANDLE`-centric implementation.

Along the way this cleans up a lot of code in `Process::spawn` for Windows by
ensuring destructors are always run, using more RAII, and limiting the scope of
`unsafe` wherever possible.
2015-04-29 08:01:16 -07:00
..
common Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
unix std: Add missing stability for symlink functions 2015-04-23 08:58:47 -07:00
windows std: Fix inheriting standard handles on windows 2015-04-29 08:01:16 -07:00