summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c1
-rw-r--r--gpsfake.py2
-rw-r--r--libgpsd_core.c4
-rw-r--r--serial.c1
4 files changed, 4 insertions, 4 deletions
diff --git a/gpsd.c b/gpsd.c
index b5ab5c78..09ba1302 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -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)
diff --git a/gpsfake.py b/gpsfake.py
index f9dcd92a..e2d6443b 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -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;
diff --git a/serial.c b/serial.c
index d1553241..41861448 100644
--- a/serial.c
+++ b/serial.c
@@ -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;
}
}