diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | io.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sun Oct 23 08:01:29 2011 Tanaka Akira <[email protected]> + + * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is + defined. reported by Luis Lavena. [ruby-core:40281] [Bug #5470] + Sat Oct 22 19:48:50 2011 Tanaka Akira <[email protected]> * test/openssl/test_ssl.rb (test_multibyte_read_write): start server @@ -159,6 +159,8 @@ rb_update_max_fd(int fd) void rb_fd_set_cloexec(int fd) { + /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */ +#ifdef F_GETFD int flags, ret; flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ if (flags == -1) { @@ -173,6 +175,7 @@ void rb_fd_set_cloexec(int fd) } } } +#endif if (max_file_descriptor < fd) max_file_descriptor = fd; } |