We may start using rand() in the worker someday if we need
to seed a hash function for caching. It saves us some LoC
in the meantime.
---
lib/PublicInbox/XapHelper.pm | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/PublicInbox/XapHelper.pm b/lib/PublicInbox/XapHelper.pm
index f7640f4c..41c66a12 100644
--- a/lib/PublicInbox/XapHelper.pm
+++ b/lib/PublicInbox/XapHelper.pm
@@ -216,14 +216,9 @@ sub reap_worker { # awaitpid CB
sub start_worker ($) {
my ($nr) = @_;
- my $pid = fork;
- if (!defined($pid)) {
- warn("fork: $!");
- return undef;
- };
+ my $pid = eval { PublicInbox::DS::do_fork } // return(warn($@));
if ($pid == 0) {
undef %WORKERS;
- PublicInbox::DS::Reset();
$SIG{TTIN} = $SIG{TTOU} = 'IGNORE';
$SIG{CHLD} = 'DEFAULT'; # Xapian may use this
recv_loop();