summaryrefslogtreecommitdiff
path: root/ext/standard/php_rand.h
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2004-01-19 02:30:54 +0000
committerfoobar <sniper@php.net>2004-01-19 02:30:54 +0000
commitc7f8c84f360dd671f30a1df426ac2b7cb72db046 (patch)
tree97a65164dee5d5aa2034cb72c22887c2193fc2b0 /ext/standard/php_rand.h
parent8ee117f8777bf6d24e4eb8b69e99c14d02637050 (diff)
downloadphp-git-c7f8c84f360dd671f30a1df426ac2b7cb72db046.tar.gz
- Fixed bug #26949 (rand(min,max) always returns min when ZTS enabled)
Diffstat (limited to 'ext/standard/php_rand.h')
-rw-r--r--ext/standard/php_rand.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index 7e705bb12d..1638a7ace7 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -33,7 +33,8 @@
#define RAND_MAX (1<<15)
#endif
-#if defined(HAVE_LRAND48) || defined(HAVE_RANDOM)
+/* In ZTS mode we rely on rand_r() so we must use RAND_MAX. */
+#if !defined(ZTS) && (defined(HAVE_LRAND48) || defined(HAVE_RANDOM))
#define PHP_RAND_MAX 2147483647
#else
#define PHP_RAND_MAX RAND_MAX