diff options
author | Gary E. Miller <gem@rellim.com> | 2015-04-02 16:45:00 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-04-02 16:45:00 -0700 |
commit | 93e95f91a7d5e6395aa6df82bb4059b411e89f9a (patch) | |
tree | 3ba282db06806757e24518e4bcbeb0b5626434eb /gpsmon.c | |
parent | 99c6d72cee7decd6001a88625c8613f376b9cbfe (diff) | |
download | gpsd-93e95f91a7d5e6395aa6df82bb4059b411e89f9a.tar.gz |
Stop infinite loop in gpsmon for /dev/pps0
Also fix debug output gsmon: -> gpsmon:
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1146,9 +1146,10 @@ int main(int argc, char **argv) volatile int maxfd = 0; char inbuf[80]; volatile bool nocurses = false; + int activated = -1; (void)putenv("TZ=UTC"); // for ctime() - gps_context_init(&context, "gsmon"); // initialize the report mutex + gps_context_init(&context, "gpsmon"); // initialize the report mutex context.serial_write = gpsmon_serial_write; context.errout.report = gpsmon_report; while ((option = getopt(argc, argv, "aD:LVhl:nt:?")) != -1) { @@ -1275,10 +1276,11 @@ int main(int argc, char **argv) "%s:%s", source.server, source.port); } - if (gpsd_activate(&session, O_PROBEONLY) == -1) { - (void)fprintf(stderr, - "gpsmon: activation of device %s failed, errno=%d (%s)\n", - session.gpsdata.dev.path, errno, strerror(errno)); + activated = gpsd_activate(&session, O_PROBEONLY); + if ( 0 > activated ) { + if ( PLACEHOLDING_FD == activated ) { + (void)fputs("gpsmon:ERROR: PPS device unsupported\n", stderr); + } exit(EXIT_FAILURE); } |