Code

Fix compilation with GCC when _GNU_SOURCE isn't defined.
authorSebastian Harl <sh@tokkee.org>
Thu, 25 Feb 2016 20:37:55 +0000 (21:37 +0100)
committerSebastian Harl <sh@tokkee.org>
Thu, 25 Feb 2016 20:37:55 +0000 (21:37 +0100)
That is, add some missing headers and bump POSIX compliance to POSIX:2008
which will ensure that 'struct timespec' is defined without funny tricks.

configure.ac
src/tools/sysdb/main.c
src/tools/sysdbd/main.c
src/utils/os.c

index 85e39c36c1a440164a3e5b31950a329d1e40bf91..c39c4af2fc726a3779b641954e054781a9d76430 100644 (file)
@@ -113,8 +113,8 @@ AC_ARG_ENABLE([standards],
 if test "x$enable_standards" = "xyes"; then
        AC_DEFINE([_ISOC99_SOURCE], 1,
                        [Define to enforce ISO/IEC 9899:1999 (C99) compliance.])
-       AC_DEFINE([_POSIX_C_SOURCE], 200112L,
-                       [Define to enforce IEEE 1003.1-2001 (POSIX:2001) compliance.])
+       AC_DEFINE([_POSIX_C_SOURCE], 200809L,
+                       [Define to enforce IEEE 1003.1-2008 (POSIX:2008) compliance.])
        AC_DEFINE([_XOPEN_SOURCE], 700,
                        [Define to enforce X/Open 7 (XSI) compliance.])
        AC_DEFINE([_REENTRANT], 1,
index e4922e9b939587c914fd7d28ef172ce0fa4a59fb..f502027f04353e115dd427cdd429816569a16116 100644 (file)
@@ -41,6 +41,7 @@
 #include "utils/ssl.h"
 
 #include <errno.h>
+#include <time.h>
 
 #if HAVE_LIBGEN_H
 #      include <libgen.h>
index 759eee2f5652ebee72c9131d22a05ddbf8f704b2..7bfbaa650c2888c5c30e183c89eb873768c5c8d3 100644 (file)
@@ -47,6 +47,7 @@
 #endif /* ! HAVE_LIBGEN_H */
 
 #include <errno.h>
+#include <time.h>
 
 #include <sys/stat.h>
 #include <fcntl.h>
index 2b6a51460a67f89122dbee5ec7d75d70e2b3fe82..8ab52c75bc023c2bc5b68ca61d2cc0f13ce0f916 100644 (file)
 #include <errno.h>
 
 #include <sys/types.h>
+#include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
 
 #include <dirent.h>
 
@@ -48,6 +51,7 @@
 #include <libgen.h>
 #include <netdb.h>
 #include <pwd.h>
+#include <time.h>
 
 /*
  * public API