mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
win32.c: fix dup2 return value
* win32/win32.c (rb_w32_dup2): should return the new fd on success, while msvcrt returns 0 wrongly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
777c719450
commit
f6d77bf560
2 changed files with 7 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue