summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b2fdfbacc..2516b5e939 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 12 19:08:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_dup2): should return the new fd on
+ success, while msvcrt returns 0 wrongly.
+
Sat Sep 12 18:14:11 2015 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError
diff --git a/win32/win32.c b/win32/win32.c
index 11292a16cc..32e77c01e4 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5934,8 +5934,9 @@ rb_w32_dup2(int oldfd, int newfd)
if (oldfd == newfd) return newfd;
ret = dup2(oldfd, newfd);
+ if (ret < 0) return ret;
set_new_std_fd(newfd);
- return ret;
+ return newfd;
}
/* License: Ruby's */