select_result((WPARAM) sftp_ssh_socket, (LPARAM) FD_READ); return 0;
if (socket_writable(sftp_ssh_socket)) select_result((WPARAM) sftp_ssh_socket, (LPARAM) FD_WRITE);  do { long next, ticks; struct timeval tv, *ptv;  if (run_timers(now, &next)) { ticks = next - GETTICKCOUNT(); if (ticks <= 0) ticks = 1;	        tv.tv_sec = ticks / 1000; tv.tv_usec = ticks % 1000 * 1000; ptv = &tv; } else { ptv = NULL; }  FD_ZERO(&readfds); FD_SET(sftp_ssh_socket, &readfds); ret = p_select(1, &readfds, NULL, NULL, ptv);  if (ret < 0) return -1;		        else if (ret == 0) now = next; else now = GETTICKCOUNT();  } while (ret == 0);  select_result((WPARAM) sftp_ssh_socket, (LPARAM) FD_READ);  return 0; } else { return do_eventsel_loop(NULL); }
int ssh_sftp_loop_iteration(void){    fd_set readfds;    if (sftp_ssh_socket == INVALID_SOCKET)	return -1;		       /* doom */    FD_ZERO(&readfds);    FD_SET(sftp_ssh_socket, &readfds);    if (p_select(1, &readfds, NULL, NULL, NULL) < 0)	return -1;		       /* doom */    select_result((WPARAM) sftp_ssh_socket, (LPARAM) FD_READ);    return 0;}