summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-18 05:42:00 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-18 05:42:00 -0400
commit80fe8fa98b266a1585afdaab3c5bf3f49c2963b9 (patch)
tree5dba162b267a3b31217de73de0547b6c00b30cb5
parentcaf45e635c8a3f2446a19b77e7842030ec10d2de (diff)
downloadgpsd-80fe8fa98b266a1585afdaab3c5bf3f49c2963b9.tar.gz
Include <sys/select.h> everywhere fd_set us used.
This came up in connection with Android. According to SuS this shouln't be necessary if sys/time.h was included, but oh well. While we;re at it, rearrange some includes for more consistent order. All regression tests pass.
-rw-r--r--driver_geostar.c2
-rw-r--r--driver_tsip.c2
-rw-r--r--gps2udp.c7
-rw-r--r--gpsctl.c1
-rw-r--r--gpsmon.c1
-rw-r--r--gpspipe.c5
-rw-r--r--libgps_sock.c1
-rw-r--r--libgpsd_core.c5
8 files changed, 17 insertions, 7 deletions
diff --git a/driver_geostar.c b/driver_geostar.c
index d81b2d2a..8b97abc8 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -19,6 +19,8 @@
#include "gpsd.h"
#include "bits.h"
+#include <sys/select.h>
+
#ifdef GEOSTAR_ENABLE
#define GEOSTAR_CHANNELS 24
diff --git a/driver_tsip.c b/driver_tsip.c
index 540e73af..c125927f 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -24,6 +24,8 @@
#include "gpsd.h"
#include "bits.h"
+#include <sys/select.h>
+
#define USE_SUPERPACKET 1 /* use Super Packet mode? */
#define SEMI_2_DEG (180.0 / 2147483647) /* 2^-31 semicircle to deg */
diff --git a/gps2udp.c b/gps2udp.c
index d652d0a5..4eb8b48f 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -11,8 +11,6 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*
*/
-#include <sys/types.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -22,8 +20,11 @@
#include <fcntl.h>
#include <termios.h>
#include <time.h>
-#include <sys/time.h>
#include <assert.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/select.h>
#ifndef S_SPLINT_S
#include <unistd.h>
diff --git a/gpsctl.c b/gpsctl.c
index 744bec4c..b3c11421 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -14,6 +14,7 @@
#include <signal.h>
#include <time.h>
#include <sys/time.h>
+#include <sys/select.h>
#ifndef S_SPLINT_S
#include <unistd.h>
#endif /* S_SPLINT_S */
diff --git a/gpsmon.c b/gpsmon.c
index 02a2c1cb..aea39d35 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -18,6 +18,7 @@
#include <sys/time.h> /* expected to declare select(2) a la SuS */
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/select.h>
#include <fcntl.h>
#ifndef S_SPLINT_S
#include <unistd.h>
diff --git a/gpspipe.c b/gpspipe.c
index 73a0d001..7e6a37b1 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -23,8 +23,6 @@
*
*/
-#include <sys/types.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -35,6 +33,9 @@
#include <termios.h>
#include <time.h>
#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/select.h>
#ifndef S_SPLINT_S
#include <unistd.h>
#endif /* S_SPLINT_S */
diff --git a/libgps_sock.c b/libgps_sock.c
index c7f706ad..015a2f17 100644
--- a/libgps_sock.c
+++ b/libgps_sock.c
@@ -16,6 +16,7 @@
#include <sys/time.h> /* expected to have a select(2) prototype a la SuS */
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/select.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
#include <unistd.h>
diff --git a/libgpsd_core.c b/libgpsd_core.c
index af0bff1a..1c2c3981 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -19,10 +19,11 @@
#include <stdarg.h>
#include <fcntl.h>
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <syslog.h>
#include <errno.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/stat.h>
#ifndef S_SPLINT_S
#include <sys/wait.h>
#include <sys/socket.h>