summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-09 20:22:14 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-09 20:22:14 -0400
commit3be9146cf2cb91e6ed2c3f1b71bd334b89bc4c18 (patch)
treec0ec2bced7e8cd485574b129a95a8b8eff3d3a8e /gpsd.c
parentae29c6691cee94bfabfc1d157a978771767892dc (diff)
downloadgpsd-3be9146cf2cb91e6ed2c3f1b71bd334b89bc4c18.tar.gz
Deal with unsubscribed gpsctls more gracefully.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index cc2b9f6a..97a3ca2c 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -949,7 +949,13 @@ static bool privileged_user(struct gps_device_t *device)
if (subscribed(sub, device))
subcount++;
}
- return subcount == 1;
+ /*
+ * Yes, zero subscribers is possible. For example, gpsctl talking
+ * to the daemon connects but doesn't necessarily issue a ?WATCH
+ * before shipping a request, which means it isn't marked as a
+ * subscribers,
+ */
+ return subcount <= 1;
}
static void set_serial(struct gps_device_t *device,