]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: drop BSD::Resource usage
authorEric Wong <e@80x24.org>
Mon, 8 Feb 2021 09:05:17 +0000 (23:05 -1000)
committerEric Wong <e@80x24.org>
Mon, 8 Feb 2021 22:07:47 +0000 (22:07 +0000)
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
script/lei

index cddb94e95d8406085c33000ea697e71b797eb27f..e2a945a4c3e88b2e102087f8941689da10de7052 100644 (file)
@@ -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: $!";
index 0b0e2976435593d73dcd97a3cacce432679ddba6..cb605e2eac1dc7bf9259b84e95dc506e5e8df4d9 100755 (executable)
@@ -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";