diff options
author | Pierre Joye <pajoye@php.net> | 2010-09-06 10:39:26 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2010-09-06 10:39:26 +0000 |
commit | 4275e7428be06162263a8644fcc5b3a43ba75ece (patch) | |
tree | 4918a634adeae304d8842d2c536727a53a611e61 /ext/standard/streamsfuncs.c | |
parent | 6c08709bd6d86f1a654ac6ff0f235ed863f67d6f (diff) | |
download | php-git-4275e7428be06162263a8644fcc5b3a43ba75ece.tar.gz |
- timeval element are always 32bit long on Windows
Diffstat (limited to 'ext/standard/streamsfuncs.c')
-rw-r--r-- | ext/standard/streamsfuncs.c | 12 |
1 files 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); |