From dc4e3d0a27e1bcff9cedfe2b3d9614cbb61c93c4 Mon Sep 17 00:00:00 2001 From: jsing Date: Fri, 10 Jan 2014 16:34:25 +0000 Subject: [PATCH] Use arc4random instead of random in the flock regress tests. ok deraadt@ --- regress/sys/kern/flock/flock.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/regress/sys/kern/flock/flock.c b/regress/sys/kern/flock/flock.c index e5e0baca04c..b6606743fc6 100644 --- a/regress/sys/kern/flock/flock.c +++ b/regress/sys/kern/flock/flock.c @@ -1174,19 +1174,17 @@ test14(int fd, int argc, const char **argv) * Child - do some work and exit. */ id = id_base + i; - srandom(getpid()); - for (j = 0; j < 50; j++) { int start, end, len; int set, wrlock; do { - start = random() & 127; - end = random() & 127; + start = arc4random_uniform(128); + end = arc4random_uniform(128); } while (end <= start); - set = random() & 1; - wrlock = random() & 1; + set = arc4random_uniform(2); + wrlock = arc4random_uniform(2); len = end - start; fl.l_start = start; -- 2.20.1