about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2016-08-09 22:02:22 +0200
committerMikael Magnusson <mikachu@gmail.com>2016-08-10 19:06:13 +0200
commitcaf48686d0e09691f004a5599a2031edb22cf5c0 (patch)
treeeda5fa9dd965c99c5fad937b9abab15e1ece127d
parentac0dcc9a63dc2a0edc62f8f1381b15b0b5ce5da3 (diff)
downloadzsh-caf48686d0e09691f004a5599a2031edb22cf5c0.tar.gz
zsh-caf48686d0e09691f004a5599a2031edb22cf5c0.tar.xz
zsh-caf48686d0e09691f004a5599a2031edb22cf5c0.zip
39014: Use special OpenBSD interface to get correct rand() behavior
-rw-r--r--ChangeLog5
-rw-r--r--Src/zsh_system.h4
-rw-r--r--configure.ac3
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8af09a396..7290210b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-10  Mikael Magnusson  <mikachu@gmail.com>
+
+	* 39014: Src/zsh_system.h, configure.ac: Use special OpenBSD
+	interface to get correct rand() behavior
+
 2016-08-06  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* unposted: Src/Zle/zle_thingy.c: fix typo in comment
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 17c4c645e..a9cbf02d0 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -882,6 +882,10 @@ extern short ospeed;
 # endif
 #endif
 
+#ifdef HAVE_SRAND_DETERMINISTIC
+# define srand srand_deterministic
+#endif
+
 #ifdef ZSH_VALGRIND
 # include "valgrind/valgrind.h"
 # include "valgrind/memcheck.h"
diff --git a/configure.ac b/configure.ac
index 9ce3a4589..bac62a638 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1322,7 +1322,8 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
 	       realpath canonicalize_file_name \
 	       symlink getcwd \
 	       cygwin_conv_path \
-	       nanosleep)
+	       nanosleep \
+	       srand_deterministic)
 AC_FUNC_STRCOLL
 
 AH_TEMPLATE([REALPATH_ACCEPTS_NULL],