cvs: php-src /ext/standard php_rand.h
| From: | Jani Taskinen | Date: | Mon, 19 Jan 2004 02:30:55 +0000 |
| Subject: | cvs: php-src /ext/standard php_rand.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-25734@lists.php.net to get a copy of this message | ||
sniper Sun Jan 18 21:30:55 2004 EDT
Modified files:
/php-src/ext/standard php_rand.h
Log:
- Fixed bug #26949 (rand(min,max) always returns min when ZTS enabled)
Index: php-src/ext/standard/php_rand.h
diff -u php-src/ext/standard/php_rand.h:1.26 php-src/ext/standard/php_rand.h:1.27
--- php-src/ext/standard/php_rand.h:1.26 Thu Jan 8 12:32:51 2004
+++ php-src/ext/standard/php_rand.h Sun Jan 18 21:30:54 2004
@@ -20,7 +20,7 @@
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_rand.h,v 1.26 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_rand.h,v 1.27 2004/01/19 02:30:54 sniper Exp $ */
#ifndef PHP_RAND_H
#define 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