Browse code

Add and fix #includes for more strict POSIX compliance

- sys/poll.h is non-standard, posix defines poll.h
- sys/time.h is needed in addition to time.h for e.g. struct timeval

Notable this fixes some build errors against musl libc

Timo Teräs authored on 28/04/2017 06:58:50
Showing 5 changed files
... ...
@@ -27,7 +27,7 @@
27 27
 
28 28
 #include <string.h>
29 29
 #include <errno.h>
30
-#include <sys/poll.h>
30
+#include <poll.h>
31 31
 
32 32
 #include <sys/types.h>
33 33
 #include <sys/socket.h>
... ...
@@ -28,6 +28,7 @@
28 28
 #ifndef LD_SESSION_H
29 29
 #define LD_SESSION_H
30 30
 
31
+#include <sys/time.h>
31 32
 #include <ldap.h>
32 33
 
33 34
 #include "iniparser.h"
... ...
@@ -25,7 +25,7 @@
25 25
 #include <string.h>/*strcmp,memset*/
26 26
 #include <errno.h>/*errno*/
27 27
 #include <unistd.h>/*close(),read(),pipe,fork,pid_t*/
28
-#include <sys/poll.h>/*poll*/
28
+#include <poll.h>/*poll*/
29 29
 #include <signal.h>/*signal*/
30 30
 #include <time.h>/*time*/
31 31
 #include <string.h>/*memcmp*/
... ...
@@ -26,7 +26,7 @@
26 26
  */
27 27
 
28 28
 
29
-#include <sys/poll.h>
29
+#include <poll.h>
30 30
 #include <openssl/err.h>
31 31
 #include <openssl/ssl.h>
32 32
 #include "../../core/dprint.h"
... ...
@@ -41,6 +41,7 @@
41 41
 #include <netdb.h> /* gethostbyname */
42 42
 #include <fcntl.h>
43 43
 #include <time.h> /* time */
44
+#include <sys/time.h>
44 45
 
45 46
 #ifdef USE_READLINE
46 47
 #include <readline/readline.h>