summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-14 23:22:41 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-14 23:22:41 +0000
commit80d5215a56b3dba4ea0e165eacb36dac976044e9 (patch)
tree24397cfafc3b024ebdb2c2c8611aa0e7b364b01a /gpsd.c
parent121d0ab329dce7f3ac5908258ef152a04820ef3a (diff)
downloadgpsd-80d5215a56b3dba4ea0e165eacb36dac976044e9.tar.gz
Prepare for 2.26 release. Wait for tty to go active in hotplug script.
Note, something seems to have come unstuck in hotplug request handling between 2.22 and 2.23. Next step, go back and fix that.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gpsd.c b/gpsd.c
index e2046e3c..3d37f552 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -217,23 +217,23 @@ static int passivesock(char *service, char *protocol, int qlen)
static int filesock(char *filename)
{
struct sockaddr_un addr;
- int s;
+ int sock;
/*@ -mayaliasunique @*/
- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+ if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
gpsd_report(0, "Can't create device-control socket\n");
return -1;
}
(void)strcpy(addr.sun_path, filename);
/*@i1@*/addr.sun_family = AF_UNIX;
- (void)bind(s, (struct sockaddr *) &addr,
+ (void)bind(sock, (struct sockaddr *) &addr,
(int)(strlen(addr.sun_path) + sizeof (addr.sun_family)));
- if (listen(s, QLEN) < 0) {
- gpsd_report(0, "Can't listen on local socket %s\n", filename);
+ if (listen(sock, QLEN) < 0) {
+ gpsd_report(0, "can't listen on local socket %s\n", filename);
return -1;
}
/*@ +mayaliasunique @*/
- return s;
+ return sock;
}
/*
@@ -963,7 +963,7 @@ int main(int argc, char *argv[])
/*
* Control socket has to be created before we go background in order to
- * avoid a race condition in which hotplug scripts can try oprning
+ * avoid a race condition in which hotplug scripts can try opening
* the socket before it's created.
*/
if (control_socket) {
@@ -973,6 +973,7 @@ int main(int argc, char *argv[])
exit(2);
}
FD_SET(csock, &all_fds);
+ gpsd_report(1, "control socket opened at %s\n", control_socket);
}
if (go_background)