summaryrefslogtreecommitdiff
path: root/libntp/iosignal.c
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2008-08-18 14:26:05 +0000
committerOllivier Robert <roberto@FreeBSD.org>2008-08-18 14:26:05 +0000
commitff717da2cf625e3d07537a93a4c240692fa55bd6 (patch)
tree9dcf618e4446ac2b5fca7d0afe7767382664f0d6 /libntp/iosignal.c
parentcce65f439697627afbccf5a67035a957bb4d784a (diff)
Notes
Diffstat (limited to 'libntp/iosignal.c')
-rw-r--r--libntp/iosignal.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/libntp/iosignal.c b/libntp/iosignal.c
index bcad890e5267..19a6e96b7401 100644
--- a/libntp/iosignal.c
+++ b/libntp/iosignal.c
@@ -3,12 +3,18 @@
* was shamelessly stolen from ntpd.
*/
-#include "ntp_machine.h"
-#include "ntpd.h"
-#include "ntp_io.h"
-#include "ntp_if.h"
-#include "ntp_stdlib.h"
-#include "iosignal.h"
+/*
+ * [Bug 158]
+ * Do the #includes differently, as under some versions of Linux
+ * sys/param.h has a #undef CONFIG_PHONE line in it.
+ *
+ * As we have ~40 CONFIG_ variables, I don't feel like renaming them
+ * every time somebody adds a new macro to some system header.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <stdio.h>
#include <signal.h>
@@ -25,6 +31,19 @@
# include <ifaddrs.h>
#endif
+# ifdef __QNXNTO__
+# include <fcntl.h>
+# include <unix.h>
+# define FNDELAY O_NDELAY
+# endif
+
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_if.h"
+#include "ntp_stdlib.h"
+#include "iosignal.h"
+
#if defined(HAVE_SIGNALED_IO)
static int sigio_block_count = 0;
# if defined(HAVE_SIGACTION)
@@ -68,12 +87,6 @@ extern void input_handler P((l_fp *));
# define USE_SIGIO
# endif
-# ifdef __QNXNTO__
-# include <fcntl.h>
-# include <unix.h>
-# define FNDELAY O_NDELAY
-# endif
-
# if defined(USE_SIGIO) && defined(USE_SIGPOLL)
# if SIGIO == SIGPOLL
# define USE_SIGIO