diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | io.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sat Nov 5 19:11:50 2011 Tanaka Akira <akr@fsij.org> + + * io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec if + fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC). + Sat Nov 5 18:05:12 2011 Tanaka Akira <akr@fsij.org> * ext/socket/socket.c (rsock_socketpair0): refactored. @@ -297,8 +297,10 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd) } /* F_DUPFD_CLOEXEC is available since Linux 2.6.24. Linux 2.6.18 fails with EINVAL */ if (errno == EINVAL) { - try_dupfd_cloexec = 0; ret = fcntl(fd, F_DUPFD, minfd); + if (ret != -1) { + try_dupfd_cloexec = 0; + } } } else { |