nonblocking examples: fix warning about unused tvdiff on Mac OS X

This commit is contained in:
Marc Hoersken 2015-03-24 21:42:10 +01:00
parent 31a5986c6d
commit 6f95c2efd3
2 changed files with 4 additions and 0 deletions

View File

@ -38,12 +38,14 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_GETTIMEOFDAY
/* diff in ms */ /* diff in ms */
static long tvdiff(struct timeval newer, struct timeval older) static long tvdiff(struct timeval newer, struct timeval older)
{ {
return (newer.tv_sec-older.tv_sec)*1000+ return (newer.tv_sec-older.tv_sec)*1000+
(newer.tv_usec-older.tv_usec)/1000; (newer.tv_usec-older.tv_usec)/1000;
} }
#endif
static int waitsocket(int socket_fd, LIBSSH2_SESSION *session) static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
{ {

View File

@ -39,12 +39,14 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_GETTIMEOFDAY
/* diff in ms */ /* diff in ms */
static long tvdiff(struct timeval newer, struct timeval older) static long tvdiff(struct timeval newer, struct timeval older)
{ {
return (newer.tv_sec-older.tv_sec)*1000+ return (newer.tv_sec-older.tv_sec)*1000+
(newer.tv_usec-older.tv_usec)/1000; (newer.tv_usec-older.tv_usec)/1000;
} }
#endif
static int waitsocket(int socket_fd, LIBSSH2_SESSION *session) static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
{ {