Skip to content

Commit

Permalink
Merge branch 'xdebug_2_3'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Nov 4, 2015
2 parents a5b2900 + 1da987c commit 20cb5c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xdebug_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,16 @@ int xdebug_create_socket(const char *hostname, int dport)
#ifdef WIN32
errno = WSAGetLastError();
if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) {
close(sockfd);
return -1;
}
#else
if (errno == EACCES) {
close(sockfd);
return -3;
}
if (errno != EINPROGRESS) {
close(sockfd);
return -1;
}
#endif
Expand All @@ -148,11 +151,13 @@ int xdebug_create_socket(const char *hostname, int dport)
FD_SET(sockfd, &eset);

if (select(sockfd+1, &rset, &wset, &eset, &timeout) == 0) {
close(sockfd);
return -2;
}

/* if our descriptor has an error */
if (FD_ISSET(sockfd, &eset)) {
close(sockfd);
return -1;
}

Expand All @@ -164,6 +169,7 @@ int xdebug_create_socket(const char *hostname, int dport)

actually_connected = getpeername(sockfd, &sa, &size);
if (actually_connected == -1) {
close(sockfd);
return -1;
}
}
Expand Down

0 comments on commit 20cb5c7

Please sign in to comment.