diff options
-rw-r--r-- | gpsd.c | 1 | ||||
-rw-r--r-- | gpsfake.py | 2 | ||||
-rw-r--r-- | libgpsd_core.c | 4 | ||||
-rw-r--r-- | serial.c | 1 |
4 files changed, 4 insertions, 4 deletions
@@ -886,7 +886,6 @@ static void handle_control(int sfd, char *buf) if ((chp = find_device(stash))) { if (chp->gpsdata.gps_fd > 0) FD_CLR(chp->gpsdata.gps_fd, &all_fds); - gpsd_deactivate(chp); notify_watchers(chp, "X=0\r\n"); for (cfd = 0; cfd < FD_SETSIZE; cfd++) if (subscribers[cfd].device == chp) @@ -303,7 +303,7 @@ class TestSession: def sanity_check(self): now = self.daemon.fd_set() if now != self.fd_set: - print "File descriptors:", now + self.progress("File descriptors: %s\n" % now) self.fd_set = now def gps_add(self, name, speed=4800, pred=None): "Add a simulated GPS being fed by the specified logfile." diff --git a/libgpsd_core.c b/libgpsd_core.c index dc79ca94..f8bb839d 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -65,9 +65,9 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context, char void gpsd_deactivate(struct gps_device_t *session) /* temporarily release the GPS device */ { - gpsd_report(1, "closing GPS=%s\n", session->gpsdata.gps_device); + gpsd_report(1, "closing GPS=%s (%d)\n", + session->gpsdata.gps_device, session->gpsdata.gps_fd); (void)gpsd_close(session); - session->gpsdata.gps_fd = -1; #ifdef NTPSHM_ENABLE (void)ntpshm_free(session->context, session->shmTime); session->shmTime = -1; @@ -193,5 +193,6 @@ void gpsd_close(struct gps_device_t *session) session->ttyset_old.c_cflag |= HUPCL; (void)tcsetattr(session->gpsdata.gps_fd,TCSANOW,&session->ttyset_old); (void)close(session->gpsdata.gps_fd); + session->gpsdata.gps_fd = -1; } } |