summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@glebius.int.ru>2011-07-04 18:16:22 +0400
committerEric S. Raymond <esr@thyrsus.com>2011-07-04 19:37:54 -0400
commit5af170931cdeb63d84ad584361601b0c182f3bca (patch)
tree5bb8d6b3a928c9cc440da3b44cbafb358b508b70 /gpsd.c
parentbd4c37d3464fefccfff3ce3c2236de09140e8d79 (diff)
downloadgpsd-5af170931cdeb63d84ad584361601b0c182f3bca.tar.gz
Consider a device subscribed inly if the subscriber has requested WATCH on it.
This fixes a bug introduced by glebius's earlier patch. Actually this bug might have been causing subtle problems since 2.95. All regression tests pass. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 45eac95d..34815bbf 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -511,7 +511,7 @@ struct subscriber_t
#define MAXSUBSCRIBERS FD_SETSIZE
#endif
-#define subscribed(sub, devp) (sub->policy.devpath[0]=='\0' || strcmp(sub->policy.devpath, devp->gpsdata.dev.path)==0)
+#define subscribed(sub, devp) (sub->policy.watcher && (sub->policy.devpath[0]=='\0' || strcmp(sub->policy.devpath, devp->gpsdata.dev.path)==0))
static struct subscriber_t subscribers[MAXSUBSCRIBERS]; /* indexed by client file descriptor */