summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-29 20:20:40 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-29 20:20:40 +0000
commit33a1ad407922354401071b2738189e21eb010f34 (patch)
tree27d87655e265a3acf98b5643790f5c811f78f2d4
parentfe4600c99a82a0be7b74fd21fe3dae3355e64d9c (diff)
downloadppe42-gcc-33a1ad407922354401071b2738189e21eb010f34.tar.gz
ppe42-gcc-33a1ad407922354401071b2738189e21eb010f34.zip
2009-05-29 Kai Tietz <kai.tietz@onevision.com>
* pex-win32.c (pex_win32_fdopenr): Set INHERIT to false. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147984 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/pex-win32.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 837dbdaca4d..5d93cf1234a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-29 Kai Tietz <kai.tietz@onevision.com>
+
+ * pex-win32.c (pex_win32_fdopenr): Set INHERIT to false.
+
2009-05-29 Michael Matz <matz@suse.de>
* 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 91e0bc882ff..44274067482 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");
}
OpenPOWER on IntegriCloud