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

(cherry picked from commit 4d485707f7e53e798466dc6ae2166eddbe874b95)
(cherry picked from commit 51f214f1c2a0b0e566ba367e5b1ac2557a05e8bd)

Timo Teräs authored on 28/04/2017 06:58:50
Showing 5 changed files
... ...
@@ -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 "../../dprint.h"
... ...
@@ -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>
... ...
@@ -49,6 +49,7 @@
49 49
 #include <netdb.h> /* gethostbyname */
50 50
 #include <fcntl.h>
51 51
 #include <time.h> /* time */
52
+#include <sys/time.h>
52 53
 
53 54
 #ifdef USE_READLINE
54 55
 #include <readline/readline.h>