-# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
package PublicInbox::Xapcmd;
use strict;
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);
}