summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-19 04:19:17 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-19 04:19:17 -0500
commitd1645133ee3aecb02f1f8f61a1e0854eb5c712da (patch)
treebb830c53d9bed842bfa0c3a2d74ebbd278266f0e /gpsmon.c
parent08198ac8b5d745cf678d0eb7c34e99deb0dc894d (diff)
downloadgpsd-d1645133ee3aecb02f1f8f61a1e0854eb5c712da.tar.gz
Add timeout on wait-for-ACK to SiRF driver.
Correct initialization observed oon SiRF-III. All regression tests pass.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 6eae3e5b..54bd0f59 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -1158,7 +1158,13 @@ int main(int argc, char **argv)
else
devicename = argv[optind];
- (void)strlcpy(session.gpsdata.dev.path, devicename,
+ /* backward compatibilty: accept a bare server name */
+ if (strchr(devicename, ':') == NULL && devicename[0] != '/')
+ (void) strlcpy(session.gpsdata.dev.path,
+ "tcp://", sizeof(session.gpsdata.dev.path));
+ else
+ session.gpsdata.dev.path[0] = '\0';
+ (void)strlcat(session.gpsdata.dev.path, devicename,
sizeof(session.gpsdata.dev.path));
if (gpsd_activate(&session, O_PROBEONLY) == -1) {