summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-10 18:50:49 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-10 18:50:49 +0000
commitdab1629290cc471813952ac03f5b031b7efb2533 (patch)
treecf059f2d428535f2ae2b96fb660aa2663b1dc542
parentfc1df0c4a76b31b805fb7de588c27ea8b7e58848 (diff)
downloadgpsd-dab1629290cc471813952ac03f5b031b7efb2533.tar.gz
Guard some inclusions that splint doesn't like.
No effect on compilation. All regression tests pass.
-rw-r--r--driver_aivdm.c2
-rw-r--r--driver_evermore.c2
-rw-r--r--driver_garmin.c2
-rw-r--r--driver_garmin_txt.c2
-rw-r--r--driver_italk.c2
-rw-r--r--driver_navcom.c2
-rw-r--r--driver_nmea.c2
-rw-r--r--driver_oncore.c2
-rw-r--r--driver_proto.c2
-rw-r--r--driver_rtcm2.c2
-rw-r--r--driver_rtcm3.c2
-rw-r--r--driver_sirf.c2
-rw-r--r--driver_superstar2.c2
-rw-r--r--driver_tsip.c2
-rw-r--r--driver_ubx.c2
-rw-r--r--driver_zodiac.c2
-rw-r--r--drivers.c2
-rw-r--r--gpsd.c4
-rw-r--r--gpsdclient.c2
-rw-r--r--gpsutils.c2
-rw-r--r--hex.c2
-rw-r--r--isgps.c2
-rw-r--r--lcdgps.c4
-rw-r--r--libgps.c2
-rw-r--r--libgpsd_core.c2
-rw-r--r--net_dgpsip.c2
-rw-r--r--net_gnss_dispatch.c2
-rw-r--r--net_ntrip.c2
-rw-r--r--netlib.c2
-rw-r--r--packet.c2
-rw-r--r--serial.c2
-rw-r--r--strl.c2
32 files changed, 64 insertions, 4 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c
index 8f90eaf4..d45d3f08 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -15,7 +15,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_evermore.c b/driver_evermore.c
index 24f9996d..f24495e1 100644
--- a/driver_evermore.c
+++ b/driver_evermore.c
@@ -118,7 +118,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_garmin.c b/driver_garmin.c
index e6074970..40b7cc9b 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -84,7 +84,9 @@
#include <math.h>
#include <string.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <errno.h>
#include <inttypes.h>
diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c
index 2b607d2e..03b54f4e 100644
--- a/driver_garmin_txt.c
+++ b/driver_garmin_txt.c
@@ -111,7 +111,9 @@ invalid data.
#include <math.h>
#include <string.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <errno.h>
#include <inttypes.h>
diff --git a/driver_italk.c b/driver_italk.c
index 224c4089..9e692ab9 100644
--- a/driver_italk.c
+++ b/driver_italk.c
@@ -8,7 +8,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_navcom.c b/driver_navcom.c
index e819e67d..0ae7dac7 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -37,7 +37,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <sys/types.h>
#include <inttypes.h>
diff --git a/driver_nmea.c b/driver_nmea.c
index 51bc1c69..6777c04c 100644
--- a/driver_nmea.c
+++ b/driver_nmea.c
@@ -1,7 +1,9 @@
/* $Id$ */
#include <sys/types.h>
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <math.h>
#include <string.h>
diff --git a/driver_oncore.c b/driver_oncore.c
index c68b68ef..fec40671 100644
--- a/driver_oncore.c
+++ b/driver_oncore.c
@@ -6,7 +6,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_proto.c b/driver_proto.c
index b43b94a3..9f3517dc 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -41,7 +41,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_rtcm2.c b/driver_rtcm2.c
index 70f3669c..4ea6da90 100644
--- a/driver_rtcm2.c
+++ b/driver_rtcm2.c
@@ -51,7 +51,9 @@ Starlink's website.
*****************************************************************************/
#include <sys/types.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
diff --git a/driver_rtcm3.c b/driver_rtcm3.c
index 58049887..a6f4c5ee 100644
--- a/driver_rtcm3.c
+++ b/driver_rtcm3.c
@@ -26,7 +26,9 @@ firmware.
*****************************************************************************/
#include <sys/types.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
diff --git a/driver_sirf.c b/driver_sirf.c
index b9322c80..ddf4c463 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -31,7 +31,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_superstar2.c b/driver_superstar2.c
index 850c5a29..b78f8600 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -5,7 +5,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
diff --git a/driver_tsip.c b/driver_tsip.c
index 5c0d804a..e021921f 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -6,7 +6,9 @@
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <math.h>
#include "gpsd_config.h"
#include "gpsd.h"
diff --git a/driver_ubx.c b/driver_ubx.c
index 907ce896..9ee3f7cb 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -9,7 +9,9 @@
#include <string.h>
#include <math.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <time.h>
#include <stdio.h>
#include <assert.h>
diff --git a/driver_zodiac.c b/driver_zodiac.c
index bf93baca..0956038c 100644
--- a/driver_zodiac.c
+++ b/driver_zodiac.c
@@ -6,7 +6,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <math.h>
#include "gpsd_config.h"
#include "gpsd.h"
diff --git a/drivers.c b/drivers.c
index 911134d7..7ad100b9 100644
--- a/drivers.c
+++ b/drivers.c
@@ -3,7 +3,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <stdlib.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <string.h>
#include <errno.h>
#include <stdio.h>
diff --git a/gpsd.c b/gpsd.c
index 1543f32d..662f578b 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -6,7 +6,9 @@
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <syslog.h>
#include <signal.h>
@@ -2000,6 +2002,7 @@ int main(int argc, char *argv[])
* It requires that all GPS devices have their group read/write
* permissions set.
*/
+ /*@-type@*/
if ((optind<argc&&stat(argv[optind], &stb)==0)||stat(PROTO_TTY,&stb)==0) {
gpsd_report(LOG_PROG, "changing to group %d\n", stb.st_gid);
if (setgid(stb.st_gid) != 0)
@@ -2015,6 +2018,7 @@ int main(int argc, char *argv[])
pw = getpwnam(GPSD_USER);
if (pw)
(void)seteuid(pw->pw_uid);
+ /*@+type@*/
}
gpsd_report(LOG_INF, "running with effective group ID %d\n", getegid());
gpsd_report(LOG_INF, "running with effective user ID %d\n", geteuid());
diff --git a/gpsdclient.c b/gpsdclient.c
index 7d99ffb2..a2ed8c03 100644
--- a/gpsdclient.c
+++ b/gpsdclient.c
@@ -2,7 +2,9 @@
/* gpsclient.c -- support functions for GPSD clients */
#include <sys/time.h>
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include <errno.h>
diff --git a/gpsutils.c b/gpsutils.c
index f30a70e7..76716d10 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -2,7 +2,9 @@
/* gpsutils.c -- code shared between low-level and high-level interfaces */
#include <sys/types.h>
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <math.h>
#include <string.h>
diff --git a/hex.c b/hex.c
index 41afcf17..35a2f4b2 100644
--- a/hex.c
+++ b/hex.c
@@ -1,5 +1,7 @@
/* $Id$ */
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
diff --git a/isgps.c b/isgps.c
index 1158d7f7..5e87d742 100644
--- a/isgps.c
+++ b/isgps.c
@@ -57,7 +57,9 @@ You are not expected to understand any of this.
*****************************************************************************/
#include <sys/types.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
diff --git a/lcdgps.c b/lcdgps.c
index 32989441..b0fbf78b 100644
--- a/lcdgps.c
+++ b/lcdgps.c
@@ -39,11 +39,15 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <math.h>
#include <errno.h>
#include <sys/select.h>
+#ifndef S_SPLINT_S
#include <sys/socket.h>
+#endif /* S_SPLINT_S */
#include <sys/time.h> /* select() */
#include <sys/stat.h>
diff --git a/libgps.c b/libgps.c
index 04a42824..cb26b92e 100644
--- a/libgps.c
+++ b/libgps.c
@@ -2,7 +2,9 @@
/* libgps.c -- client interface library for the gpsd daemon */
#include <sys/time.h>
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include <errno.h>
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 44d42103..98d1cf31 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -4,9 +4,9 @@
#include <sys/ioctl.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
+#include <unistd.h>
#endif /* S_SPLINT_S */
#include <sys/time.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
diff --git a/net_dgpsip.c b/net_dgpsip.c
index 9e5ab3dd..d1591e66 100644
--- a/net_dgpsip.c
+++ b/net_dgpsip.c
@@ -3,9 +3,9 @@
#include <sys/types.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
+#include <unistd.h>
#endif /* S_SPLINT_S */
#include <sys/time.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
diff --git a/net_gnss_dispatch.c b/net_gnss_dispatch.c
index ca8286fd..78f58618 100644
--- a/net_gnss_dispatch.c
+++ b/net_gnss_dispatch.c
@@ -4,9 +4,9 @@
#include <sys/types.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
+#include <unistd.h>
#endif /* S_SPLINT_S */
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include "gpsd_config.h"
diff --git a/net_ntrip.c b/net_ntrip.c
index 6293a23a..91345dd3 100644
--- a/net_ntrip.c
+++ b/net_ntrip.c
@@ -3,9 +3,9 @@
#include <sys/types.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
+#include <unistd.h>
#endif /* S_SPLINT_S */
#include <sys/time.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
diff --git a/netlib.c b/netlib.c
index 6705fadf..2382198c 100644
--- a/netlib.c
+++ b/netlib.c
@@ -21,7 +21,9 @@
#include <arpa/inet.h>
#include <errno.h>
#include <stdlib.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <string.h>
#include "gpsd.h"
diff --git a/packet.c b/packet.c
index f000e434..830ea5ce 100644
--- a/packet.c
+++ b/packet.c
@@ -27,7 +27,9 @@ others apart and distinguish them from baud barf.
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <string.h>
#include <errno.h>
#include <netinet/in.h> /* for htons() */
diff --git a/serial.c b/serial.c
index ee6d4907..9d585f47 100644
--- a/serial.c
+++ b/serial.c
@@ -1,7 +1,9 @@
/* $Id$ */
#include <sys/types.h>
#include <sys/stat.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <string.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/strl.c b/strl.c
index 26b25ee9..bb47eea1 100644
--- a/strl.c
+++ b/strl.c
@@ -1,6 +1,8 @@
/* $Id$ */
#include <stdio.h>
+#ifndef S_SPLINT_S
#include <unistd.h>
+#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <string.h>
#include "gpsd_config.h"