cvs: /php3/functions lcg.c uniqid.c
| From: | Sascha Schumann | Date: | Fri, 17 Sep 1999 17:51:57 +0000 |
| Subject: | cvs: /php3/functions lcg.c uniqid.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11042@lists.php.net to get a copy of this message | ||
sas Fri Sep 17 13:51:57 1999 EDT
Modified files:
/php3/functions lcg.c uniqid.c
Log:
Improve lcg initialization and remove PHP4 traces from uniqid().
Index: php3/functions/lcg.c
diff -u php3/functions/lcg.c:1.1 php3/functions/lcg.c:1.2
--- php3/functions/lcg.c:1.1 Sat Aug 21 13:41:02 1999
+++ php3/functions/lcg.c Fri Sep 17 13:51:56 1999
@@ -19,6 +19,10 @@
#include "php.h"
#include "php_lcg.h"
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#ifdef ZTS
int lcg_globals_id;
#else
@@ -54,7 +58,7 @@
static void init_globals(LCGLS_D)
{
LCG(s1) = 1;
- LCG(s2) = 1;
+ LCG(s2) = (long) getpid();
}
static int php_minit_lcg(INIT_FUNC_ARGS)
Index: php3/functions/uniqid.c
diff -u php3/functions/uniqid.c:1.37 php3/functions/uniqid.c:1.38
--- php3/functions/uniqid.c:1.37 Fri Sep 17 13:39:18 1999
+++ php3/functions/uniqid.c Fri Sep 17 13:51:56 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: uniqid.c,v 1.37 1999/09/17 17:39:18 sas Exp $ */
+/* $Id: uniqid.c,v 1.38 1999/09/17 17:51:56 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
@@ -66,12 +66,12 @@
TLS_VARS;
argc = ARG_COUNT(ht);
- if (argc < 1 || argc > 2 || getParameters(ht,ac,&prefix,&flags)==FAILURE) {
+ if (argc < 1 || argc > 2 || getParameters(ht,argc,&prefix,&flags)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(prefix);
if (argc == 2) {
- convert_to_boolean(flags);
+ convert_to_long(flags);
}
/* Do some bounds checking since we are using a char array. */