mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (rb_cloexec_fcntl_dupfd): Fix failures in
bootstrap_test/test_io.rb. NativeClient does not support F_DUPFD but supports dup2(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1fe680e812
commit
0626021e13
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Jan 4 00:29:40 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
|
||||
|
||||
* io.c (rb_cloexec_fcntl_dupfd): Fix failures in
|
||||
bootstrap_test/test_io.rb. NativeClient does not support F_DUPFD
|
||||
but supports dup2(2).
|
||||
|
||||
Thu Jan 3 17:46:50 2013 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rexml/element.rb (REXML::Elements#add): Remove too much
|
||||
|
|
6
io.c
6
io.c
|
@ -298,7 +298,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
|
|||
{
|
||||
int ret;
|
||||
|
||||
#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC)
|
||||
#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC) && !defined(__native_client__)
|
||||
static int try_dupfd_cloexec = 1;
|
||||
if (try_dupfd_cloexec) {
|
||||
ret = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
|
||||
|
@ -318,8 +318,10 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
|
|||
else {
|
||||
ret = fcntl(fd, F_DUPFD, minfd);
|
||||
}
|
||||
#else
|
||||
#elif defined(HAVE_FCNTL) && !defined(__native_client__)
|
||||
ret = fcntl(fd, F_DUPFD, minfd);
|
||||
#else
|
||||
ret = dup2(fd, minfd);
|
||||
#endif
|
||||
if (ret == -1) return -1;
|
||||
rb_maygvl_fd_fix_cloexec(ret);
|
||||
|
|
Loading…
Reference in a new issue