From: Kai Tietz Date: Fri, 29 May 2009 20:20:40 +0000 (+0000) Subject: pex-win32.c (pex_win32_fdopenr): Set INHERIT to false. X-Git-Tag: releases/gcc-4.5.0~5482 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb870b58e27150a19d8e456074e348e9e768d7c1;p=thirdparty%2Fgcc.git pex-win32.c (pex_win32_fdopenr): Set INHERIT to false. 2009-05-29 Kai Tietz * pex-win32.c (pex_win32_fdopenr): Set INHERIT to false. From-SVN: r147984 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 837dbdaca4d3..5d93cf1234ae 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2009-05-29 Kai Tietz + + * pex-win32.c (pex_win32_fdopenr): Set INHERIT to false. + 2009-05-29 Michael Matz * fibheap.c (fibheap_replace_key_data): Make sure we don't early diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c index 91e0bc882ff1..44274067482c 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"); }