From c7f8c84f360dd671f30a1df426ac2b7cb72db046 Mon Sep 17 00:00:00 2001 From: foobar Date: Mon, 19 Jan 2004 02:30:54 +0000 Subject: [PATCH] - Fixed bug #26949 (rand(min,max) always returns min when ZTS enabled) --- ext/standard/php_rand.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.50.1