aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-22 02:34:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-22 02:34:00 +0000
commit18b520443cfdf145f3cd7fd22f192c04dc0da9fc (patch)
treee784b16c2601cc124ac1cb4912b85ca3f81a2694
parent30d762795cf3078764102d9921f875116d5d77a9 (diff)
downloadruby-18b520443cfdf145f3cd7fd22f192c04dc0da9fc.tar.gz
* win32/win32.c (dupfd): argument of _osfhnd and so on should not
have side effect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b6b8206c1..fc661ac7d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (dupfd): argument of _osfhnd and so on should not
+ have side effect.
+
Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
* 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;