From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 985F81F44D for ; Fri, 12 Apr 2024 17:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1712943588; bh=lCQaSqlCq+AQ+Za6Kd2k9hyIqSYltxzb7paDda7B6SM=; h=From:To:Subject:Date:From; b=WC7ugc5TWfm0JySZmsru+uokb5Wwsb2LCx3tN4Uo5ZTNnFqgz8FhRTD9VrixA3Wud 5zGUkpmwCNTZRx+2EFjzMmugwdeyBHOThvKima76AxKQsPhn1ts9J4pNzOlrAh4xCI kiLS0yPAhH7HjdZzEF4eG1TaFKuV64h8akkLHqA0= From: Eric Wong To: spew@80x24.org Subject: [PATCH] io: avoid redundant waitpid in DESTROY Date: Fri, 12 Apr 2024 17:39:48 +0000 Message-ID: <20240412173948.2739904-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We shouldn't attempt to reap a process again after it's been reaped asynchronously in the SIGCHLD handler. --- lib/PublicInbox/IO.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/IO.pm b/lib/PublicInbox/IO.pm index 02057600..106489be 100644 --- a/lib/PublicInbox/IO.pm +++ b/lib/PublicInbox/IO.pm @@ -60,7 +60,7 @@ sub DESTROY { my $reap = delete ${*$io}{pi_io_reap}; if (($reap->[0] // -1) == $PublicInbox::OnDestroy::fork_gen) { $io->SUPER::close; - awaitpid($reap->[1]); + $reap->[2] // awaitpid($reap->[1]); } $io->SUPER::DESTROY; }