sockfilt.c: commit b44da5a82a follow-up 2

This commit is contained in:
Yang Tse 2012-12-26 20:03:35 +01:00
parent 77b5c0b2cf
commit eb5aa12c8b
1 changed files with 5 additions and 4 deletions

View File

@ -422,7 +422,8 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
WSAEVENT wsaevent, *wsaevents; WSAEVENT wsaevent, *wsaevents;
WSANETWORKEVENTS wsanetevents; WSANETWORKEVENTS wsanetevents;
HANDLE *handles; HANDLE *handles;
int error, fds, *fdarr; curl_socket_t *fdarr;
int error, fds;
DWORD nfd = 0, wsa = 0; DWORD nfd = 0, wsa = 0;
int ret = 0; int ret = 0;
@ -437,7 +438,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
} }
/* allocate internal array for the original input handles */ /* allocate internal array for the original input handles */
fdarr = malloc(nfds * sizeof(int)); fdarr = malloc(nfds * sizeof(curl_socket_t));
if(fdarr == NULL) { if(fdarr == NULL) {
errno = ENOMEM; errno = ENOMEM;
return -1; return -1;
@ -472,7 +473,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
networkevents |= FD_CLOSE; networkevents |= FD_CLOSE;
if(networkevents) { if(networkevents) {
fdarr[nfd] = fds; fdarr[nfd] = (curl_socket_t)fds;
if(fds == fileno(stdin)) { if(fds == fileno(stdin)) {
handles[nfd] = GetStdHandle(STD_INPUT_HANDLE); handles[nfd] = GetStdHandle(STD_INPUT_HANDLE);
} }
@ -599,7 +600,7 @@ static bool juggle(curl_socket_t *sockfdp,
FD_ZERO(&fds_write); FD_ZERO(&fds_write);
FD_ZERO(&fds_err); FD_ZERO(&fds_err);
FD_SET(fileno(stdin), &fds_read); FD_SET((curl_socket_t)fileno(stdin), &fds_read);
switch(*mode) { switch(*mode) {