From 4275e7428be06162263a8644fcc5b3a43ba75ece Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 6 Sep 2010 10:39:26 +0000 Subject: [PATCH] - timeval element are always 32bit long on Windows --- ext/standard/streamsfuncs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 170618f76c..bc4cd935a6 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); -- 2.40.0