From: Kazuhiro NISHIYAMA Date: 2003-12-04T22:48:53+09:00 Subject: [ruby-dev:22139] Re: invalid parameter to fcntl in drb.rb 西山和広です。 In On Wed, 3 Dec 2003 20:22:32 +0900 Masatoshi SEKI wrote: > > @@ -901,5 +901,5 @@ module DRb > > soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) > > soc.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) if defined? > > Fcntl::O_NONBLOCK > > - soc.fcntl(Fcntl::F_SETFL, Fcntl::FD_CLOEXEC) if defined? > > Fcntl::FD_CLOEXEC > > + soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? > > Fcntl::FD_CLOEXEC > > end > > end > > ありがとうございます。 > 修正してcommitしました。 削られてしまうとOpenBSD 3.3でtest/drb/test_drbssl.rbで 1) Error: test_02_collect(TestDRbSSLAry): DRb::DRbConnError: drbssl://example.com:26966 - # などのエラーになったり、テストの実行が止まったりするようなので、 こんな感じでどうでしょうか? Index: drb.rb =================================================================== RCS file: /src/ruby/lib/drb/drb.rb,v retrieving revision 1.11 diff -u -p -u -r1.11 drb.rb --- drb.rb 4 Dec 2003 12:50:13 -0000 1.11 +++ drb.rb 4 Dec 2003 13:48:01 -0000 @@ -904,7 +904,14 @@ module DRb def set_sockopt(soc) # :nodoc: soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) soc.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) if defined? Fcntl::O_NONBLOCK - soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC + if defined? Fcntl::FD_CLOEXEC + soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) + begin + soc.fcntl(Fcntl::F_SETFL, Fcntl::FD_CLOEXEC) + rescue Errno::EINVAL + # ignore + end + end end end -- |ZnZ(ゼット エヌ ゼット) |西山和広(Kazuhiro NISHIYAMA)