From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS46457 204.124.83.0/24 X-Spam-Status: No, score=-0.6 required=3.0 tests=AWL,BAYES_00, RCVD_IN_BRBL_LASTEXT,RCVD_IN_XBL shortcircuit=no autolearn=no version=3.3.2 X-Original-To: spew@80x24.org Received: from 80x24.org (tor-exit0.conformal.com [204.124.83.130]) by dcvr.yhbt.net (Postfix) with ESMTP id 30FF91FACE for ; Mon, 11 May 2015 20:17:40 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH 2/3] lib/drb/*.rb: avoid redundant fcntl call Date: Mon, 11 May 2015 20:17:31 +0000 Message-Id: <1431375452-6061-2-git-send-email-e@80x24.org> In-Reply-To: <1431375452-6061-1-git-send-email-e@80x24.org> References: <1431375452-6061-1-git-send-email-e@80x24.org> List-Id: Sockets are close-on-exec by default since Ruby 2.0, so it is redundant to set it again. --- lib/drb/drb.rb | 2 -- lib/drb/unix.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index 32e5bfb..456d0fb 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -47,7 +47,6 @@ require 'socket' require 'thread' -require 'fcntl' require 'io/wait' require 'drb/eq' @@ -1013,7 +1012,6 @@ module DRb def set_sockopt(soc) # :nodoc: soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) - soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC end end diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb index 3fb8d0e..637ea7c 100644 --- a/lib/drb/unix.rb +++ b/lib/drb/unix.rb @@ -108,7 +108,7 @@ module DRb end def set_sockopt(soc) - soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC + # no-op for now end end -- EW