Hi,

Some of the examples did not build because sys/time.h was needed, I
added this to the #ifndef WIN32 block becuase I have no idea if win32
has a sys/time.h :)

Also, we need libssh2 to build with older compilers, so something
needs to be done for src/session.c. I don't really expect this part of
the patch to be applied.

Thanks,
Peter
Index: src/session.c
===================================================================
--- src/session.c.orig  2007-04-18 02:02:26.000000000 +0000
+++ src/session.c       2007-04-26 18:29:58.746793000 +0000
@@ -738,7 +738,7 @@
        unsigned int i, active_fds;
 #ifdef HAVE_POLL
        LIBSSH2_SESSION *session = NULL;
-       struct pollfd sockets[nfds];
+       struct pollfd * sockets = malloc(nfds * sizeof(struct pollfd));
        /* FIXME: (dast) this is not C89 code! However, the prototype for this
           function doesn't provide a session struct so we can't easily use
           the user-provided malloc replacement here... I suggest we modify
@@ -770,6 +770,7 @@
                                return -1;
                }
        }
+       free(sockets);
 #elif defined(HAVE_SELECT)
        LIBSSH2_SESSION *session = NULL;
        int maxfd = 0;
Index: example/simple/scp_nonblock.c
===================================================================
--- example/simple/scp_nonblock.c.orig  2007-02-02 16:21:20.000000000 +0000
+++ example/simple/scp_nonblock.c       2007-04-26 18:29:58.804400000 +0000
@@ -10,6 +10,7 @@
 # include <netinet/in.h>
 # include <sys/socket.h>
 # include <unistd.h>
+# include <sys/time.h>
 #else
 # include <winsock2.h>
 #endif
Index: example/simple/sftp_nonblock.c
===================================================================
--- example/simple/sftp_nonblock.c.orig 2007-04-23 02:02:14.000000000 +0000
+++ example/simple/sftp_nonblock.c      2007-04-26 18:31:06.373781000 +0000
@@ -17,6 +17,7 @@
 # include <sys/socket.h>
 # include <unistd.h>
 # include <arpa/inet.h>
+# include <sys/time.h>
 #else
 # include <winsock2.h>
 #endif
Index: example/simple/sftp_RW_nonblock.c
===================================================================
--- example/simple/sftp_RW_nonblock.c.orig      2007-04-22 14:15:47.000000000 
+0000
+++ example/simple/sftp_RW_nonblock.c   2007-04-26 21:56:13.467658000 +0000
@@ -16,6 +16,7 @@
 # include <netinet/in.h>
 # include <sys/socket.h>
 # include <unistd.h>
+# include <sys/time.h>
 #else
 # include <winsock2.h>
 #endif
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to