diff options
Diffstat (limited to 'lib/PublicInbox/Xapcmd.pm')
-rw-r--r-- | lib/PublicInbox/Xapcmd.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index 8de516ef..269aa99a 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -89,8 +89,10 @@ sub commit_changes ($$$$) { sub cb_spawn { my ($cb, $args, $opt) = @_; # $cb = cpdb() or compact() - defined(my $pid = fork) or die "fork: $!"; + my $seed = rand(0xffffffff); + my $pid = fork // die "fork: $!"; return $pid if $pid > 0; + srand($seed); $cb->($args, $opt); POSIX::_exit(0); } |