Re: cvs: php-src /ext/standard uniqid.c
| From: | Steph Fox | Date: | Sun, 25 Dec 2005 14:42:30 +0000 |
| Subject: | Re: cvs: php-src /ext/standard uniqid.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-36267@lists.php.net to get a copy of this message | ||
- ok so I'm slowly catching up on weeklies (even tho' it's Christmas Day bleh)
This doesn't make any sense to me, at all.
#if defined(__CYGWIN__)
zend_bool more_entropy = 1;
#else
zend_bool more_entropy = 0;
#endif
...
...
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len,
&more_entropy)) {
return;
}
...
...
#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!more_entropy) {
#if defined(__CYGWIN__)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN.");
RETURN_FALSE;
#else
usleep(1);
#endif
}
#endif
I can just about get my head around the idea that PHP_WIN32 might not be defined where CYGWIN is (just about) but, assuming it gets past that crisis, the only time you'd ever see that warning would be when you'd _used_ the optional 'more_entropy' parameter under Cygwin to pass 0...
Wouldn't it be better to start with more_entropy = 0 for everyone, force more_entropy = 1 under Cygwin regardless of (but after) user input, and/or maybe emit a more appropriate E_NOTICE/E_WARNING if the Cygwin-based user tries to set it to 0?
----- Original Message ----- From: "Marcus Boerger" <helly@php.net>
To: "Ilia Alshanetsky" <iliaa@php.net>
Cc: <php-cvs@lists.php.net>
Sent: Wednesday, October 19, 2005 8:27 PM
Subject: Re: [PHP-CVS] cvs: php-src /ext/standard uniqid.c
Hello Ilia, why did you change this, the E_ERROR was there to make clear it does not work and can never work.... Wednesday, October 19, 2005, 3:41:37 PM, you wrote:iliaa Wed Oct 19 09:41:37 2005 EDTModified files:Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php/php-src/ext/standard uniqid.cLog: Change E_ERROR to E_WARNING when more_entropy flag is off on Cygwin. http://cvs.php.net/diff.php/php-src/ext/standard/uniqid.c?r1=1.42&r2=1.43&ty=u Index: php-src/ext/standard/uniqid.c diff -u php-src/ext/standard/uniqid.c:1.42 php-src/ext/standard/uniqid.c:1.43 --- php-src/ext/standard/uniqid.c:1.42 Tue Aug 23 08:53:30 2005+++ php-src/ext/standard/uniqid.c Wed Oct 19 09:41:36 2005@@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uniqid.c,v 1.42 2005/08/23 12:53:30 dmitry Exp $ */ +/* $Id: uniqid.c,v 1.43 2005/10/19 13:41:36 iliaa Exp $ */ #include "php.h" @@ -61,8 +61,8 @@ #if HAVE_USLEEP && !defined(PHP_WIN32)if (!more_entropy) {#if defined(__CYGWIN__)- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You must use 'more entropy' under CYGWIN."); - return; + php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN."); + RETURN_FALSE;#elseusleep(1);#endif