about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/spawn.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/spawn.t b/t/spawn.t
index 5b17ed38..45517852 100644
--- a/t/spawn.t
+++ b/t/spawn.t
@@ -6,6 +6,7 @@ use Test::More;
 use PublicInbox::Spawn qw(which spawn popen_rd run_qx);
 require PublicInbox::Sigfd;
 require PublicInbox::DS;
+use PublicInbox::OnDestroy;
 my $rlimit_map = PublicInbox::Spawn->can('rlimit_map');
 {
         my $true = which('true');
@@ -171,7 +172,7 @@ EOF
         my @arg;
         my $fh = popen_rd(['cat'], undef, { 0 => $r },
                         sub { @arg = @_; warn "x=$$\n" }, 'hi');
-        my $pid = fork // BAIL_OUT $!;
+        my $pid = PublicInbox::OnDestroy::fork_tmp;
         local $SIG{__WARN__} = sub { _exit(1) };
         if ($pid == 0) {
                 local $SIG{__DIE__} = sub { _exit(2) };