summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-04-30 23:04:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-04-30 23:05:37 -0400
commit321c7710c3f3a17d56e9e5eede9aebadbaf16e3e (patch)
treefae8712111ede1cd948e8846a3bbdafeb8dfd45a /gpsd.c
parent5aa7ce8d00de15c832ab90113ef5b08221746e7f (diff)
downloadgpsd-321c7710c3f3a17d56e9e5eede9aebadbaf16e3e.tar.gz
Fix static-checker warnings. All regression tests pass.
cppchecker now finds variables that could have reduced scope; that's most of these.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index e71ecb96..ff4435c7 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -2273,7 +2273,6 @@ int main(int argc, char *argv[])
for (i = 0; i < AFCOUNT; i++) {
if (msocks[i] >= 0 && FD_ISSET(msocks[i], &rfds)) {
socklen_t alen = (socklen_t) sizeof(fsin);
- char *c_ip;
/*@+matchanyintegral@*/
socket_t ssock =
accept(msocks[i], (struct sockaddr *)&fsin, &alen);
@@ -2285,6 +2284,7 @@ int main(int argc, char *argv[])
struct subscriber_t *client = NULL;
int opts = fcntl(ssock, F_GETFL);
static struct linger linger = { 1, RELEASE_TIMEOUT };
+ char *c_ip;
if (opts >= 0)
(void)fcntl(ssock, F_SETFL, opts | O_NONBLOCK);