Richard W.M. Jones' 5 patches that enables libssh2 to get cross-compiled with

mingw
This commit is contained in:
Daniel Stenberg
2008-11-10 16:48:41 +00:00
parent 95b73812e7
commit 5438cffd9a
17 changed files with 114 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: sftp_mkdir_nonblock.c,v 1.10 2008/09/30 08:55:35 bagder Exp $
* $Id: sftp_mkdir_nonblock.c,v 1.11 2008/11/10 16:48:41 bagder Exp $
*
* Sample showing how to do SFTP non-blocking mkdir.
*
@@ -9,7 +9,7 @@
* "sftp 192.168.0.1 user password /tmp/sftp_write_nonblock.c"
*/
#include "config.h"
#include "libssh2_config.h"
#include <libssh2.h>
#include <libssh2_sftp.h>
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
#ifdef WIN32
WSADATA wsadata;
WSAStartup(WINSOCK_VERSION, &wsadata);
WSAStartup(MAKEWORD(2,0), &wsadata);
#endif
if (argc > 1) {
@@ -97,7 +97,12 @@ int main(int argc, char *argv[])
#elif defined(HAVE_IOCTLSOCKET)
ioctlsocket(sock, FIONBIO, &flag);
#else
#ifdef WIN32
u_long mode = 1;
ioctlsocket (sock, FIONBIO, &mode);
#else
#error "add support for setting the socket non-blocking here"
#endif
#endif
/* Create a session instance