aboutsummaryrefslogtreecommitdiff
path: root/libiberty/pex-win32.c
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2009-05-29 20:19:14 +0000
committerKai Tietz <kai.tietz@onevision.com>2009-05-29 20:19:14 +0000
commitb69c3c55861291390782dbc5fb72484400458a1d (patch)
tree28dde16e1f3768e09e10e24df992a131d6ef1d90 /libiberty/pex-win32.c
parentab730e720d0430afd030fb178737e15f3190f5dd (diff)
downloadgdb-b69c3c55861291390782dbc5fb72484400458a1d.zip
gdb-b69c3c55861291390782dbc5fb72484400458a1d.tar.gz
gdb-b69c3c55861291390782dbc5fb72484400458a1d.tar.bz2
2009-05-29 Kai Tietz <kai.tietz@onevision.com>
* pex-win32.c (pex_win32_fdopenr): Set INHERIT to false.
Diffstat (limited to 'libiberty/pex-win32.c')
-rw-r--r--libiberty/pex-win32.c5
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");
}