summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/pp.c
diff options
context:
space:
mode:
authorAndrew Fresh <afresh1@cvs.openbsd.org>2014-12-30 20:46:46 +0000
committerAndrew Fresh <afresh1@cvs.openbsd.org>2014-12-30 20:46:46 +0000
commit8c76c5b31e47d18e12915765a6aa44f742a8d735 (patch)
treedfbf2481d16f96a36e97b9aecfabbd73ec35fbbc /gnu/usr.bin/perl/pp.c
parent5c4edef4864b9b2172dd7ca5fb57502652baf783 (diff)
Make perl use our (arc4random backed) drand48 when unseeded
uses srand48_deterministic if a seed is provided. seems fine millert@
Diffstat (limited to 'gnu/usr.bin/perl/pp.c')
-rw-r--r--gnu/usr.bin/perl/pp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/pp.c b/gnu/usr.bin/perl/pp.c
index 4ec6887dfd6..79abdb01f89 100644
--- a/gnu/usr.bin/perl/pp.c
+++ b/gnu/usr.bin/perl/pp.c
@@ -2785,9 +2785,12 @@ PP(pp_srand)
}
}
else {
- anum = seed();
+ anum = 0;
}
+ if (anum)
+ (void)srand48_deterministic((Rand_seed_t)anum);
+ else
(void)seedDrand01((Rand_seed_t)anum);
PL_srand_called = TRUE;
if (anum)