[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix error: dereferencing pointer to incomplete type ‘struct timeval’


Signed-off-by: Xiang Xiao <xiaoxiang@xxxxxxxxxx>
Change-Id: I99d2016595966d805c9e27b5c2f2a0a5b4ad8611
---
 src/channels.c | 3 +++
 src/connect.c  | 3 +++
 src/sftp.c     | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/src/channels.c b/src/channels.c
index 4eea885b..d72f864a 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -29,6 +29,9 @@
 #include <errno.h>
 #include <time.h>
 #include <stdbool.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
 
 #ifndef _WIN32
 #include <netinet/in.h>
diff --git a/src/connect.c b/src/connect.c
index 252e2c63..ce4d58df 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -29,6 +29,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
 
 #include "libssh/libssh.h"
 #include "libssh/misc.h"
diff --git a/src/sftp.c b/src/sftp.c
index 9a10b075..72450474 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -32,6 +32,9 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdint.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <limits.h>
-- 
2.25.1


Archive administrator: postmaster@lists.cynapses.org