From e680c28694b3feec79d7399e8a6d9d80676a9dd1 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 24 Jul 2003 15:23:14 +0000 Subject: [PATCH] MFH: Fix for #24629 --- ext/standard/file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; } -- 2.50.1