mirror of
https://github.com/php/php-src.git
synced 2025-01-11 13:34:24 +08:00
MFB51: Fixed bug #35900 (stream_select() should warning when tv_sec is
negative).
This commit is contained in:
parent
7f5c395781
commit
a9b90524d5
@ -763,6 +763,14 @@ PHP_FUNCTION(stream_select)
|
||||
if (sec != NULL) {
|
||||
convert_to_long(sec);
|
||||
|
||||
if (sec < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater then 0.");
|
||||
RETURN_FALSE;
|
||||
} else if (usec < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The microseconds parameter must be greater then 0.");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Solaris + BSD do not like microsecond values which are >= 1 sec */
|
||||
if (usec > 999999) {
|
||||
tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000);
|
||||
|
Loading…
Reference in New Issue
Block a user