X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/8c7d710ce382c85e38ce4fb73fd357e00e7d5ed2..c4c04facf82078b66673e1dfc607ee27f1adc490:/winsftp.c diff --git a/winsftp.c b/winsftp.c index 6687210f..52c827a2 100644 --- a/winsftp.c +++ b/winsftp.c @@ -2,15 +2,6 @@ * winsftp.c: the Windows-specific parts of PSFTP and PSCP. */ -#include -#ifndef AUTO_WINSOCK -#ifdef WINSOCK_TWO -#include -#else -#include -#endif -#endif - #include "putty.h" #include "psftp.h" @@ -298,7 +289,7 @@ DirHandle *open_directory(char *name) char *findfile; DirHandle *ret; - /* To enumerate files in dir `foo', we search for `foo/*'. */ + /* Enumerate files in dir `foo'. */ findfile = dupcat(name, "/*", NULL); h = FindFirstFile(findfile, &fdat); if (h == INVALID_HANDLE_VALUE) @@ -481,25 +472,6 @@ char *do_select(SOCKET skt, int startup) extern int select_result(WPARAM, LPARAM); /* - * Initialize the WinSock driver. - */ -static void init_winsock(void) -{ - WORD winsock_ver; - WSADATA wsadata; - - winsock_ver = MAKEWORD(1, 1); - if (WSAStartup(winsock_ver, &wsadata)) { - fprintf(stderr, "Unable to initialise WinSock"); - cleanup_exit(1); - } - if (LOBYTE(wsadata.wVersion) != 1 || HIBYTE(wsadata.wVersion) != 1) { - fprintf(stderr, "WinSock version is incompatible with 1.1"); - cleanup_exit(1); - } -} - -/* * Wait for some network data and process it. */ int ssh_sftp_loop_iteration(void) @@ -511,7 +483,7 @@ int ssh_sftp_loop_iteration(void) FD_ZERO(&readfds); FD_SET(sftp_ssh_socket, &readfds); - if (select(1, &readfds, NULL, NULL, NULL) < 0) + if (p_select(1, &readfds, NULL, NULL, NULL) < 0) return -1; /* doom */ select_result((WPARAM) sftp_ssh_socket, (LPARAM) FD_READ); @@ -525,9 +497,7 @@ int main(int argc, char *argv[]) { int ret; - init_winsock(); ret = psftp_main(argc, argv); - WSACleanup(); return ret; }