about summary refs log tree commit homepage
path: root/lib/PublicInbox/DS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r--lib/PublicInbox/DS.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index eefbdcc3..9960937d 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -34,6 +34,7 @@ use PublicInbox::Tmpfile;
 use PublicInbox::Select;
 use Errno qw(EAGAIN EINVAL ECHILD);
 use Carp qw(carp croak);
+use autodie qw(fork);
 our @EXPORT_OK = qw(now msg_more awaitpid add_timer add_uniq_timer);
 
 my $nextq; # queue for next_tick
@@ -737,6 +738,17 @@ sub awaitpid {
         }
 }
 
+sub do_fork () {
+        my $seed = rand(0xffffffff);
+        my $pid = fork;
+        if ($pid == 0) {
+                srand($seed);
+                eval { Net::SSLeay::randomize() };
+                Reset();
+        }
+        $pid;
+}
+
 package PublicInbox::DummyPoller; # only used during Reset
 use v5.12;