summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/bin/tests/genrandom.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/bin/tests/genrandom.c')
-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");