From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B8DE21FC0C for ; Mon, 8 Feb 2021 09:05:22 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 09/13] lei: drop BSD::Resource usage Date: Sun, 7 Feb 2021 23:05:17 -1000 Message-Id: <20210208090521.28909-10-e@80x24.org> In-Reply-To: <20210208090521.28909-1-e@80x24.org> References: <20210208090521.28909-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's no longer necessary with the changes to stop doing FD passing in our backend. cf. commits 5180ed0a1cd65139 and 7d440bf3667b8ef5 ("lei q: eliminate $not_done temporary git dir hack") ("lei q: reorder internals to reduce FD passing") --- lib/PublicInbox/LEI.pm | 5 ----- script/lei | 8 -------- 2 files changed, 13 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index cddb94e9..e2a945a4 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -941,11 +941,6 @@ sub lazy_start { $! = $errno; # allow interpolation to stringify in die die "connect($path): $!"; } - if (eval { require BSD::Resource }) { - my $NOFILE = BSD::Resource::RLIMIT_NOFILE(); - my ($s, $h) = BSD::Resource::getrlimit($NOFILE); - BSD::Resource::setrlimit($NOFILE, $h, $h) if $s < $h; - } umask(077) // die("umask(077): $!"); bind($listener, $addr) or die "bind($path): $!"; listen($listener, 1024) or die "listen: $!"; diff --git a/script/lei b/script/lei index 0b0e2976..cb605e2e 100755 --- a/script/lei +++ b/script/lei @@ -82,14 +82,6 @@ Falling back to (slow) one-shot mode while (my ($k, $v) = each %ENV) { $buf .= "\0$k=$v" } $buf .= "\0\0"; my $n = $send_cmd->($sock, [0, 1, 2, fileno($dh)], $buf, MSG_EOR); - if (!$n && $!{ETOOMANYREFS} && eval { require BSD::Resource }) { - my $NOFILE = BSD::Resource::RLIMIT_NOFILE(); - my ($s, $h) = BSD::Resource::getrlimit($NOFILE); - if ($s < $h && BSD::Resource::setrlimit($NOFILE, $h, $h)) { - $n = $send_cmd->($sock, [0, 1, 2, fileno($dh)], - $buf, MSG_EOR); - } - } if (!$n) { die "sendmsg: $! (check RLIMIT_NOFILE)\n" if $!{ETOOMANYREFS}; die "sendmsg: $!\n";