diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 05:16:36 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 05:16:36 +0000 |
commit | bc4381667a31bd5f1e677d64c789b1e959df00d5 (patch) | |
tree | a6b80dca8f72a2e7640e4d535901e42325b2a954 /gcc/ada/adaint.c | |
parent | 1cd66bce1663eb648638d311b493de0dcc4146c3 (diff) | |
parent | 738c50b853f5ba0eaf93e23f6d29cbac761eef9e (diff) | |
download | gcc-reload-v2a.tar.gz |
Weekly merge from trunk. No regressions.reload-v2a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/reload-v2a@181834 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r-- | gcc/ada/adaint.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 7e701f53c14..dde33429575 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -2449,6 +2449,14 @@ __gnat_dup2 (int oldfd, int newfd) /* Not supported on VxWorks 5.x, but supported on VxWorks 6.0 when using RTPs. */ return -1; +#elif defined (_WIN32) + /* Special case when oldfd and newfd are identical and are the standard + input, output or error as this makes Windows XP hangs. Note that we + do that only for standard file descriptors that are known to be valid. */ + if (oldfd == newfd && newfd >= 0 && newfd <= 2) + return newfd; + else + return dup2 (oldfd, newfd); #else return dup2 (oldfd, newfd); #endif |