From: Eric Wong Date: Fri, 15 Nov 2019 09:50:41 +0000 (+0000) Subject: xapcmd: do not fire END and DESTROY handlers in child X-Git-Tag: v1.3.0~291 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b05207350b218972fc7614c75b49eaae26f9013a;p=public-inbox.git xapcmd: do not fire END and DESTROY handlers in child 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. --- 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 ($) {