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-ASN: 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 8CCFD1F5AE for ; Fri, 15 Nov 2019 09:51:02 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/29] xapcmd: do not fire END and DESTROY handlers in child Date: Fri, 15 Nov 2019 09:50:41 +0000 Message-Id: <20191115095100.25633-11-e@80x24.org> In-Reply-To: <20191115095100.25633-1-e@80x24.org> References: <20191115095100.25633-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We need to bypass whatever Test::More does with END/DESTROY handlers for use in lon-lived process. This doesn't affect any of our normal code since we don't use END/DESTROY for Xapcmd and its callers. --- lib/PublicInbox/Xapcmd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index 77f0524e..28285898 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -9,6 +9,7 @@ use PublicInbox::Search; use File::Temp qw(tempdir); use File::Path qw(remove_tree); use File::Basename qw(dirname); +use POSIX (); # support testing with dev versions of Xapian which installs # commands with a version number suffix (e.g. "xapian-compact-1.5") @@ -85,7 +86,7 @@ sub cb_spawn { defined(my $pid = fork) or die "fork: $!"; return $pid if $pid > 0; $cb->($args, $opt); - exit 0; + POSIX::_exit(0); } sub runnable_or_die ($) {