Skip to content

Instantly share code, notes, and snippets.

@weltling
Created November 30, 2016 19:37
Show Gist options
  • Save weltling/a605c3608a4416bdbc5bf36d6c4bd859 to your computer and use it in GitHub Desktop.
Save weltling/a605c3608a4416bdbc5bf36d6c4bd859 to your computer and use it in GitHub Desktop.
--- a/xdebug_com.c
+++ b/xdebug_com.c
@@ -59,17 +59,18 @@ int xdebug_create_socket(const char *hostname, int dport TSRMLS_DC)
int actually_connected;
struct sockaddr_in6 sa;
socklen_t size = sizeof(sa);
- struct pollfd ufds[1];
#if WIN32|WINNT
+ WSAPOLLFD ufds[1];
WORD wVersionRequested;
WSADATA wsaData;
char optval = 1;
- const char yes = 1;
+ ULONG yes = 1;
u_long no = 0;
wVersionRequested = MAKEWORD(2, 2);
WSAStartup(wVersionRequested, &wsaData);
#else
+ struct pollfd ufds[1];
long optval = 1;
#endif
@@ -108,7 +109,7 @@ int xdebug_create_socket(const char *hostname, int dport TSRMLS_DC)
/* Put socket in non-blocking mode so we can use poll for timeouts */
#ifdef WIN32
- ioctlsocket(sockfd, FIONBIO, (u_long*)&yes);
+ ASSERT(ioctlsocket(sockfd, FIONBIO, (u_long*)&yes) != -1);
#else
fcntl(sockfd, F_SETFL, O_NONBLOCK);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment