* Be told what socket we're supposed to be using.
*/
static SOCKET sftp_ssh_socket = INVALID_SOCKET;
-static HANDLE netevent = NULL;
+static HANDLE netevent = INVALID_HANDLE_VALUE;
char *do_select(SOCKET skt, int startup)
{
int events;
handles = sresize(handles, nhandles+2, HANDLE);
nallhandles = nhandles;
- if (netevent)
+ if (netevent != INVALID_HANDLE_VALUE)
handles[netindex = nallhandles++] = netevent;
else
netindex = -1;
- if (other_event)
+ if (other_event != INVALID_HANDLE_VALUE)
handles[otherindex = nallhandles++] = other_event;
else
otherindex = -1;
- n = MsgWaitForMultipleObjects(nallhandles, handles, FALSE, ticks,
- QS_POSTMESSAGE);
+ n = WaitForMultipleObjects(nallhandles, handles, FALSE, ticks);
if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
handle_got_event(handles[n - WAIT_OBJECT_0]);
return 0;
} else {
- return do_eventsel_loop(NULL);
+ return do_eventsel_loop(INVALID_HANDLE_VALUE);
}
}