From: jsing Date: Fri, 10 Jan 2014 16:34:25 +0000 (+0000) Subject: Use arc4random instead of random in the flock regress tests. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dc4e3d0a27e1bcff9cedfe2b3d9614cbb61c93c4;p=openbsd Use arc4random instead of random in the flock regress tests. ok deraadt@ --- 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;