diff options
author | Gary E. Miller <gem@rellim.com> | 2015-04-02 16:54:43 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-04-02 16:54:43 -0700 |
commit | f84929ad326a9211e03ceca938c6afb9490b4cbf (patch) | |
tree | aa9f6c3941f6428ed9742ed2d58c97cf89230f8d /gpsctl.c | |
parent | 93e95f91a7d5e6395aa6df82bb4059b411e89f9a (diff) | |
download | gpsd-f84929ad326a9211e03ceca938c6afb9490b4cbf.tar.gz |
gpsctl now correctly identifies a PPS device in direct mode.
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -623,6 +623,8 @@ int main(int argc, char **argv) */ if (!(forcetype != NULL && echo)) { int maxfd = 0; + int activated = -1; + if (device == NULL) { gpsd_log(&context.errout, LOG_ERROR, "device must be specified for low-level access.\n"); @@ -630,7 +632,13 @@ int main(int argc, char **argv) } gpsd_init(&session, &context, device); - if (gpsd_activate(&session, O_PROBEONLY) < 0) { + activated = gpsd_activate(&session, O_PROBEONLY); + if ( 0 > activated ) { + if ( PLACEHOLDING_FD == activated ) { + (void)printf("%s identified as a %s.\n", + device, gpsd_id(&session)); + exit(EXIT_SUCCESS); + } gpsd_log(&context.errout, LOG_ERROR, "initial GPS device %s open failed\n", device); |