summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2014-12-14 23:47:33 +0100
committerMarco d'Itri <md@linux.it>2014-12-26 19:55:51 +0100
commit4fa1cd69e45dc29249e8abc413278a7982c996c5 (patch)
tree00fb6259b34fb62d37fd2d10bfae5b21dace6867 /config.h
parentb207df0805d431d379bba52cff499cbbca288c64 (diff)
downloadwhois-4fa1cd69e45dc29249e8abc413278a7982c996c5.tar.gz
mkpasswd: use arc4random_buf where available
Diffstat (limited to 'config.h')
-rw-r--r--config.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/config.h b/config.h
index 4492e4b..7e324f7 100644
--- a/config.h
+++ b/config.h
@@ -81,6 +81,15 @@
# define RANDOM_DEVICE "/dev/urandom"
#endif
+/* use arc4random_buf instead if it is available */
+#if (defined __FreeBSD__ && __FreeBSD__ >= 9) || \
+ (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || \
+ (defined OpenBSD && OpenBSD >= 200805) || \
+ (defined __APPLE__ && defined __MACH__)
+# define HAVE_ARC4RANDOM_BUF
+# undef RANDOM_DEVICE
+#endif
+
#ifdef ENABLE_NLS
# ifndef NLS_CAT_NAME
# define NLS_CAT_NAME "whois"