diff options
author | Eric Wong <e@80x24.org> | 2023-10-17 23:37:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-18 20:50:30 +0000 |
commit | a4cf3bd57d17577b6dd791d4f0f8e76758d0aafe (patch) | |
tree | b15a6f5d269a9ec0e984d4e5b2cedac5f9388d1a /lib/PublicInbox/TestCommon.pm | |
parent | e6e098ab8ebf5eefceee10fc165e192cf6bd8e91 (diff) | |
download | public-inbox-a4cf3bd57d17577b6dd791d4f0f8e76758d0aafe.tar.gz |
This ensures we handle RNG reseeding and resetting the event loop properly in child processes after forking.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 323152b4..77da822b 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -549,9 +549,8 @@ sub start_script { require PublicInbox::OnDestroy; my $tmp_mask = PublicInbox::OnDestroy->new( \&PublicInbox::DS::sig_setmask, $oset); - my $pid = fork // die "fork: $!"; + my $pid = PublicInbox::DS::do_fork(); if ($pid == 0) { - eval { PublicInbox::DS->Reset }; for (@{delete($opt->{-CLOFORK}) // []}) { close($_) or die "close $!"; } |