From: Jason Greene Date: Fri, 25 Jul 2003 01:50:09 +0000 (+0000) Subject: MFH: fix for #24629 X-Git-Tag: php-4.3.3RC2~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dbbc057c5fafc78f8ea9002bb76caca5599d82f;p=php MFH: fix for #24629 --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index e88fcb61c8..d8f41d8bca 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -592,8 +592,16 @@ PHP_FUNCTION(socket_select) convert_to_long(&tmp); sec = &tmp; } - tv.tv_sec = Z_LVAL_P(sec); - tv.tv_usec = usec; + + /* Solaris + BSD do not like microsecond values which are >= 1 sec */ + 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; if (sec == &tmp) {