From: Wez Furlong Date: Thu, 24 Jul 2003 15:23:14 +0000 (+0000) Subject: MFH: Fix for #24629 X-Git-Tag: php-4.3.3RC2~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e680c28694b3feec79d7399e8a6d9d80676a9dd1;p=php MFH: Fix for #24629 --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 82c9c8b2f4..334fcc1855 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -808,8 +808,14 @@ PHP_FUNCTION(stream_select) /* If seconds is not set to null, build the timeval, else we wait indefinitely */ if (sec != NULL) { convert_to_long_ex(&sec); - tv.tv_sec = Z_LVAL_P(sec); - tv.tv_usec = usec; + + if (usec > 999999) { + tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); + tv.tv_usec = usec % 1000000; + } else { + tv.tv_sec = Z_LVAL_P(sec); + tv.tv_usec = usec; + } tv_p = &tv; }