diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-09 20:22:14 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-09 20:22:14 -0400 |
commit | 3be9146cf2cb91e6ed2c3f1b71bd334b89bc4c18 (patch) | |
tree | c0ec2bced7e8cd485574b129a95a8b8eff3d3a8e /gpsd.c | |
parent | ae29c6691cee94bfabfc1d157a978771767892dc (diff) | |
download | gpsd-3be9146cf2cb91e6ed2c3f1b71bd334b89bc4c18.tar.gz |
Deal with unsubscribed gpsctls more gracefully.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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, |