]> 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 170618f76c7674acb44c61eaed268485b480e564..bc4cd935a6017440aee67c890eb0753d708ac473 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);