summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-13 08:44:04 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-13 08:44:04 -0400
commitdf28d9d7f9eabd2373df031fa2939d0b41ee6caa (patch)
tree71ea48f96eeb2d42457764a0e64c0c109c92ffa7 /gpsd.c
parentf0a7a853d5eac933f60b562f3b44102296c9e23f (diff)
downloadgpsd-df28d9d7f9eabd2373df031fa2939d0b41ee6caa.tar.gz
splint/cppcheck/coverity prerelease cleanup.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gpsd.c b/gpsd.c
index 9526ead5..aafb126f 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1966,7 +1966,7 @@ int main(int argc, char *argv[])
}
/*@+unrecog@*/
- if (pid_file) {
+ if (pid_file != NULL) {
FILE *fp;
if ((fp = fopen(pid_file, "w")) != NULL) {
@@ -1991,7 +1991,8 @@ int main(int argc, char *argv[])
gpsd_log(&context.errout, LOG_ERR,
"command sockets creation failed, netlib errors %d, %d\n",
msocks[0], msocks[1]);
- (void)unlink(pid_file);
+ if (pid_file != NULL)
+ (void)unlink(pid_file);
exit(EXIT_FAILURE);
}
gpsd_log(&context.errout, LOG_INF, "listening on port %s\n", gpsd_service);