From: Pierre Joye Date: Mon, 6 Sep 2010 10:39:26 +0000 (+0000) Subject: - timeval element are always 32bit long on Windows X-Git-Tag: php-5.4.0alpha1~191^2~994 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8648b1beff40511821c3bf7e0110b69fe937acbd;p=php - timeval element are always 32bit long on Windows --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 3f44a5c0a6..d1a07ac5b0 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -116,9 +116,13 @@ PHP_FUNCTION(stream_socket_client) /* prepare the timeout value for use */ conv = (php_timeout_ull) (timeout * 1000000.0); +#ifdef PHP_WIN32 + tv.tv_sec = (long)(conv / 1000000); + tv.tv_usec =(long)(conv % 1000000); +#else tv.tv_sec = conv / 1000000; tv.tv_usec = conv % 1000000; - +#endif if (zerrno) { zval_dtor(zerrno); ZVAL_LONG(zerrno, 0); @@ -258,9 +262,13 @@ PHP_FUNCTION(stream_socket_accept) /* prepare the timeout value for use */ conv = (php_timeout_ull) (timeout * 1000000.0); +#ifdef PHP_WIN32 + tv.tv_sec = (long)(conv / 1000000); + tv.tv_usec = (long)(conv % 1000000); +#else tv.tv_sec = conv / 1000000; tv.tv_usec = conv % 1000000; - +#endif if (zpeername) { zval_dtor(zpeername); ZVAL_NULL(zpeername);