summaryrefslogtreecommitdiff
path: root/gpsd.c
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 /gpsd.c
parentfc1df0c4a76b31b805fb7de588c27ea8b7e58848 (diff)
downloadgpsd-dab1629290cc471813952ac03f5b031b7efb2533.tar.gz
Guard some inclusions that splint doesn't like.
No effect on compilation. All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c4
1 files changed, 4 insertions, 0 deletions
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());