summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-01-10 16:34:26 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-01-10 16:34:26 +0000
commit2f8769db2c009367205f55a9015129702007bb12 (patch)
tree3c8518210134aab95daf5e6071b3729f13241741 /regress/sys/kern
parentcd4d200cf75c5c1b8dae1639eda10a413723cab4 (diff)
Use arc4random instead of random in the flock regress tests.
ok deraadt@
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/flock/flock.c10
1 files 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;