1
1

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

Этот коммит содержится в:
Marc Hoersken 2015-03-24 21:42:10 +01:00
родитель 31a5986c6d
Коммит 6f95c2efd3
2 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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)
{ {

Просмотреть файл

@ -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)
{ {