PHP 4.0 Bug #9340 Updated: usleep function doesn't work properly under winNT 4.0
| From: | jmoore@php.net | Date: | Sat, 24 Feb 2001 19:18:48 +0000 |
| Subject: | PHP 4.0 Bug #9340 Updated: usleep function doesn't work properly under winNT 4.0 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47408@lists.php.net to get a copy of this message | ||
ID: 9340
Updated by: jmoore
Reported By: dror@europe.com
Old-Status: Feedback
Status: Closed
Bug Type: Date/time related
Assigned To:
Comments:
Fixed in CVS
Previous Comments:
---------------------------------------------------------------------------
[2001-02-22 19:26:17] sniper@php.net
Please try the latest dev build from http://www.php4win.de/
(under downloads) as this should be fixed already in CVS. IIRC
--Jani
---------------------------------------------------------------------------
[2001-02-19 13:16:08] dror@europe.com
here is the wrong code (current) + my correction:
---- > Wrong (current) <----
PHP_FUNCTION(usleep)
{
#if HAVE_USLEEP
pval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(num);
usleep((*num)->value.lval);
#endif
}
---- > Correction <----
PHP_FUNCTION(usleep)
{
pval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(num);
#if HAVE_USLEEP
usleep((*num)->value.lval);
#elif PHP_WIN32
Sleep( ((*num)->value.lval+999)/1000);
#endif
}
Dror.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9340&edit=2