diff options
author | Gary E. Miller <gem@rellim.com> | 2015-03-29 14:33:41 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-03-29 14:33:41 -0700 |
commit | 8a254d4074a73b6db19fd7943bd9349f2feb12e6 (patch) | |
tree | af15dfb63ce888744eef1daa0c3bca6fb32b1338 /serial.c | |
parent | 6781a7cbacc68d130bb57d024e9d47479ec126be (diff) | |
download | gpsd-8a254d4074a73b6db19fd7943bd9349f2feb12e6.tar.gz |
Do not let gpsd_serial_open() try to open a /dev/pps
For some reason the ppsthread no longer tries to open /dev/pps0, Either
before or after this patch.
Here is the current status:
root@raspberrypi:/usr/local/src/GPS/gpsd/gpsd# gpsd -nND 6 /dev/pps0 /dev/ttyAMA0 |& fgrep pps0
gpsd:INFO: stashing device /dev/pps0 at slot 0
gpsd:ERROR: initial GPS device /dev/pps0 open failed
gpsd:INFO: KPPS:/dev/ttyAMA0 checking /sys/devices/virtual/pps/pps0/path,
[... no more output]
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -416,13 +416,18 @@ void gpsd_set_speed(struct gps_device_t *session, } int gpsd_serial_open(struct gps_device_t *session) -/* open a device for access to its data */ +/* open a device for access to its data + * return the fd of the open device, or -1 for failure, -2 is a PPS device */ { mode_t mode = (mode_t) O_RDWR; session->sourcetype = gpsd_classify(session->gpsdata.dev.path); session->servicetype = service_sensor; + if ( source_pps == session->sourcetype ) { + return -2; + } + /*@ -boolops -type @*/ if (session->context->readonly || (session->sourcetype <= source_blockdev)) { |