diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2009-05-29 20:20:40 +0000 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2009-05-29 22:20:40 +0200 |
commit | bb870b58e27150a19d8e456074e348e9e768d7c1 (patch) | |
tree | 27d87655e265a3acf98b5643790f5c811f78f2d4 /libiberty/pex-win32.c | |
parent | 7a2faca1c536095a4e3ae8053037fe16ac0e7a1f (diff) | |
download | gcc-bb870b58e27150a19d8e456074e348e9e768d7c1.zip gcc-bb870b58e27150a19d8e456074e348e9e768d7c1.tar.gz gcc-bb870b58e27150a19d8e456074e348e9e768d7c1.tar.bz2 |
pex-win32.c (pex_win32_fdopenr): Set INHERIT to false.
2009-05-29 Kai Tietz <kai.tietz@onevision.com>
* pex-win32.c (pex_win32_fdopenr): Set INHERIT to false.
From-SVN: r147984
Diffstat (limited to 'libiberty/pex-win32.c')
-rw-r--r-- | libiberty/pex-win32.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c index 91e0bc8..4427406 100644 --- a/libiberty/pex-win32.c +++ b/libiberty/pex-win32.c @@ -915,6 +915,11 @@ static FILE * pex_win32_fdopenr (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd, int binary) { + HANDLE h = (HANDLE) _get_osfhandle (fd); + if (h == INVALID_HANDLE_VALUE) + return NULL; + if (! SetHandleInformation (h, HANDLE_FLAG_INHERIT, 0)) + return NULL; return fdopen (fd, binary ? "rb" : "r"); } |