diff options
author | Anatol Belski <ab@php.net> | 2014-10-23 11:05:47 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-23 11:05:47 +0200 |
commit | 91652cf3c7c937e96917282c978a00b859c946de (patch) | |
tree | f7ad52c6a8a0ae9fc9faec1e7f2472619dadffc7 /ext/standard/fsock.c | |
parent | 451065a434046565fb6a3af22d1a8eea64a6088b (diff) | |
download | php-git-91652cf3c7c937e96917282c978a00b859c946de.tar.gz |
fix datatype mismatches
Diffstat (limited to 'ext/standard/fsock.c')
-rw-r--r-- | ext/standard/fsock.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 090d3f8f32..30a6fda5d6 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) { |