]> granicus.if.org Git - php/commitdiff
- timeval element are always 32bit long on Windows
authorPierre Joye <pajoye@php.net>
Mon, 6 Sep 2010 10:39:26 +0000 (10:39 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 6 Sep 2010 10:39:26 +0000 (10:39 +0000)
ext/standard/streamsfuncs.c

index 3f44a5c0a6a159f34943e9626fe2e2d5cc91ff32..d1a07ac5b0b2c215ef4dc9e9c7ac913896a18ad6 100644 (file)
@@ -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);