com php-src: fix datatype mismatches: ext/standard/fsock.c
| From: | Anatol Belski | Date: | Thu, 23 Oct 2014 09:05:47 +0000 |
| Subject: | com php-src: fix datatype mismatches: ext/standard/fsock.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82474@lists.php.net to get a copy of this message | ||
Commit: 91652cf3c7c937e96917282c978a00b859c946de
Author: Anatol Belski <ab@php.net> Thu, 23 Oct 2014 11:05:47 +0200
Parents: 451065a434046565fb6a3af22d1a8eea64a6088b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=91652cf3c7c937e96917282c978a00b859c946de
Log:
fix datatype mismatches
Changed paths:
M ext/standard/fsock.c
Diff:
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 090d3f8..30a6fda 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -35,14 +35,18 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
size_t host_len;
zend_long port = -1;
zval *zerrno = NULL, *zerrstr = NULL;
- double timeout = FG(default_socket_timeout);
- zend_ulong conv;
+ double timeout = (double)FG(default_socket_timeout);
+#ifndef PHP_WIN32
+ time_t conv;
+#else
+ long conv;
+#endif
struct timeval tv;
char *hashkey = NULL;
php_stream *stream = NULL;
int err;
char *hostname = NULL;
- zend_long hostname_len;
+ size_t hostname_len;
zend_string *errstr = NULL;
RETVAL_FALSE;
@@ -63,8 +67,13 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
/* prepare the timeout value for use */
- conv = (unsigned long) (timeout * 1000000.0);
+#ifndef PHP_WIN32
+ conv = (time_t) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
+#else
+ conv = (long) (timeout * 1000000.0);
+ tv.tv_sec = conv / 1000000;
+#endif
tv.tv_usec = conv % 1000000;
if (zerrno) {