1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-31 00:03:08 +03:00

examples: fix various compiler warnings

This commit is contained in:
Daniel Stenberg
2019-03-15 16:45:57 +01:00
parent bd5a620d1a
commit 54ff8ffc6d
5 changed files with 25 additions and 35 deletions

View File

@ -90,6 +90,7 @@ int main(int argc, char *argv[])
char mem[1000];
struct timeval timeout;
fd_set fd;
fd_set fd2;
#ifdef WIN32
WSADATA wsadata;
@ -253,11 +254,12 @@ int main(int argc, char *argv[])
timeout.tv_usec = 0;
FD_ZERO(&fd);
FD_ZERO(&fd2);
FD_SET(sock, &fd);
FD_SET(sock, &fd2);
/* wait for readable or writeable */
rc = select(sock+1, &fd, &fd, NULL, &timeout);
rc = select(sock+1, &fd, &fd2, NULL, &timeout);
if(rc <= 0) {
/* negative is error
0 is timeout */
@ -312,11 +314,12 @@ int main(int argc, char *argv[])
timeout.tv_usec = 0;
FD_ZERO(&fd);
FD_ZERO(&fd2);
FD_SET(sock, &fd);
FD_SET(sock, &fd2);
/* wait for readable or writeable */
rc = select(sock+1, &fd, &fd, NULL, &timeout);
rc = select(sock+1, &fd, &fd2, NULL, &timeout);
if(rc <= 0) {
/* negative is error
0 is timeout */