summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/bin/tests
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2003-01-20 21:38:11 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2003-01-20 21:38:11 +0000
commit7f89b43ca33a9d451ce5c05e5496f6c946d9686c (patch)
tree0156613e6a63715bf8b1ef0ef98fe51bed4fae21 /usr.sbin/bind/bin/tests
parentfd8895cefbac5a00b704125713478abca7e62d05 (diff)
use arc4random()
Diffstat (limited to 'usr.sbin/bind/bin/tests')
-rw-r--r--usr.sbin/bind/bin/tests/genrandom.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/bind/bin/tests/genrandom.c b/usr.sbin/bind/bin/tests/genrandom.c
index e1996115cf2..34c4bdd6900 100644
--- a/usr.sbin/bind/bin/tests/genrandom.c
+++ b/usr.sbin/bind/bin/tests/genrandom.c
@@ -47,9 +47,15 @@ main(int argc, char **argv) {
exit(1);
}
+#ifndef HAVE_ARC4RANDOM
srand(0x12345678);
+#endif
while (bytes > 0) {
+#ifndef HAVE_ARC4RANDOM
unsigned short int x = (rand() & 0xFFFF);
+#else
+ unsigned short int x = (arc4random() & 0xFFFF);
+#endif
unsigned char c = x & 0xFF;
if (putc(c, fp) == EOF) {
printf("error writing to file\n");