summaryrefslogtreecommitdiff
path: root/gpsctl.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-04-02 16:54:43 -0700
committerGary E. Miller <gem@rellim.com>2015-04-02 16:54:43 -0700
commitf84929ad326a9211e03ceca938c6afb9490b4cbf (patch)
treeaa9f6c3941f6428ed9742ed2d58c97cf89230f8d /gpsctl.c
parent93e95f91a7d5e6395aa6df82bb4059b411e89f9a (diff)
downloadgpsd-f84929ad326a9211e03ceca938c6afb9490b4cbf.tar.gz
gpsctl now correctly identifies a PPS device in direct mode.
Diffstat (limited to 'gpsctl.c')
-rw-r--r--gpsctl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gpsctl.c b/gpsctl.c
index 425c6721..655999ad 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -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);