diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win32/win32.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <[email protected]> + + * win32/win32.c (dupfd): argument of _osfhnd and so on should not + have side effect. + Tue Nov 22 11:26:08 2011 NARUSE, Yui <[email protected]> * bignum.c (): refix of r33536. Don't change behavior of Bignum#/. diff --git a/win32/win32.c b/win32/win32.c index c7f853ce81..89bca5ac4f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3818,8 +3818,9 @@ dupfd(HANDLE hDup, char flags, int minfd) close_fds_and_return: save_errno = errno; while (filled > 0) { - _osfhnd(fds[--filled]) = (intptr_t)INVALID_HANDLE_VALUE; - close(fds[filled]); + int fd = fds[--filled]; + _osfhnd(fd) = (intptr_t)INVALID_HANDLE_VALUE; + close(fd); } errno = save_errno; |