summaryrefslogtreecommitdiff
path: root/main/network.c
diff options
context:
space:
mode:
authorJason Greene <jason@php.net>2002-07-19 20:34:35 +0000
committerJason Greene <jason@php.net>2002-07-19 20:34:35 +0000
commit217ef0d1150ece6be221b466f2aee48a5166d751 (patch)
treeed5c07b6364f52622a45b8a2f21b4e1197babf6b /main/network.c
parent887e1ffe5725e4c755e8b72897e128f80c2cb6ec (diff)
downloadphp-git-217ef0d1150ece6be221b466f2aee48a5166d751.tar.gz
Fix feof() on win32
Bug #18436
Diffstat (limited to 'main/network.c')
-rw-r--r--main/network.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/network.c b/main/network.c
index 323d7f0673..046c5562c7 100644
--- a/main/network.c
+++ b/main/network.c
@@ -368,9 +368,12 @@ PHPAPI int php_connect_nonb_win32(SOCKET sockfd,
*/
int php_hostconnect(const char *host, unsigned short port, int socktype, int timeout)
{
- int n, repeatto, s, err;
+ int n, repeatto, s;
struct sockaddr **sal, **psal;
struct timeval timeoutval;
+#ifdef PHP_WIN32
+ int err;
+#endif
n = php_network_getaddresses(host, &sal);
@@ -765,7 +768,7 @@ printf("read_internal read %d/%d bytes\n", nr_bytes, sock->chunk_size);
memcpy(WRITEPTR(sock), buf, nr_bytes);
sock->writepos += nr_bytes;
nr_read = nr_bytes;
- } else if(nr_bytes == 0 || (nr_bytes < 0 && errno != EWOULDBLOCK)) {
+ } else if(nr_bytes == 0 || (nr_bytes < 0 && streams_socket_errno != EWOULDBLOCK)) {
sock->eof = 1;
}