about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-04-01 06:49:38 +0000
committerEric Wong <e@80x24.org>2024-04-03 08:28:07 +0000
commita145f5acf90fff0b146e6e871925950f62fb426a (patch)
tree493ebdb7d2cb55fdba9b667c47d27f3a253f3d32 /t
parent108196adad5e70b6dd40dc431cd1033d44679483 (diff)
downloadpublic-inbox-a145f5acf90fff0b146e6e871925950f62fb426a.tar.gz
There are still some places where on_destroy isn't suitable,
This gets rid of getpid() calls in most of those cases to
reduce syscall costs and cleanup syscall trace output.
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) };