iliaa Wed Aug 20 12:40:23 2003 EDT
Modified files:
/php-src/main reentrancy.c
/php-src/ext/standard php_rand.h
Log:
Fixed bug #25170 (Problem with generation of random numbers on solaris)
Index: php-src/main/reentrancy.c
diff -u php-src/main/reentrancy.c:1.38 php-src/main/reentrancy.c:1.39
--- php-src/main/reentrancy.c:1.38 Tue Jun 10 16:03:42 2003
+++ php-src/main/reentrancy.c Wed Aug 20 12:40:21 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: reentrancy.c,v 1.38 2003/06/10 20:03:42 imajes Exp $ */
+/* $Id: reentrancy.c,v 1.39 2003/08/20 16:40:21 iliaa Exp $ */
#include <sys/types.h>
#include <string.h>
@@ -35,7 +35,7 @@
#endif
#include "php_reentrancy.h"
-#include "ext/standard/php_rand.h" /* for RAND_MAX */
+#include "ext/standard/php_rand.h" /* for PHP_RAND_MAX */
enum {
LOCALTIME_R,
@@ -368,7 +368,7 @@
static int
do_rand(unsigned long *ctx)
{
- return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1));
+ return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)PHP_RAND_MAX + 1));
}
Index: php-src/ext/standard/php_rand.h
diff -u php-src/ext/standard/php_rand.h:1.24 php-src/ext/standard/php_rand.h:1.25
--- php-src/ext/standard/php_rand.h:1.24 Tue Aug 12 20:49:22 2003
+++ php-src/ext/standard/php_rand.h Wed Aug 20 12:40:22 2003
@@ -20,7 +20,7 @@
| Based on code from: Shawn Cokus <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_rand.h,v 1.24 2003/08/13 00:49:22 pollita Exp $ */
+/* $Id: php_rand.h,v 1.25 2003/08/20 16:40:22 iliaa Exp $ */
#ifndef PHP_RAND_H
#define PHP_RAND_H
@@ -33,7 +33,7 @@
#define RAND_MAX (1<<15)
#endif
-#if HAVE_LRAND48 && !defined(__sun)
+#if defined(HAVE_LRAND48) || defined(HAVE_RANDOM)
#define PHP_RAND_MAX 2147483647
#else
#define PHP_RAND_MAX RAND_MAX
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php