ruby-changes:39760
From: nobu <ko1@a...>
Date: Sat, 12 Sep 2015 19:09:24 +0900 (JST)
Subject: [ruby-changes:39760] nobu:r51841 (trunk): win32.c: fix dup2 return value
nobu 2015-09-12 19:09:03 +0900 (Sat, 12 Sep 2015) New Revision: 51841 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51841 Log: win32.c: fix dup2 return value * win32/win32.c (rb_w32_dup2): should return the new fd on success, while msvcrt returns 0 wrongly. Modified files: trunk/ChangeLog trunk/win32/win32.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51840) +++ ChangeLog (revision 51841) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Sep 12 19:08:58 2015 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError Index: win32/win32.c =================================================================== --- win32/win32.c (revision 51840) +++ win32/win32.c (revision 51841) @@ -5934,8 +5934,9 @@ rb_w32_dup2(int oldfd, int newfd) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5934 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 */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/