diff options
author | Eric Wong <e@80x24.org> | 2024-04-01 06:49:38 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-04-03 08:28:07 +0000 |
commit | a145f5acf90fff0b146e6e871925950f62fb426a (patch) | |
tree | 493ebdb7d2cb55fdba9b667c47d27f3a253f3d32 /t | |
parent | 108196adad5e70b6dd40dc431cd1033d44679483 (diff) | |
download | public-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.t | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) }; |