summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-25 13:18:09 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-25 13:18:09 +0000
commita00d0c4bf92866317e777648d2624961aa76f9a2 (patch)
treeaf1e36ad73fe86cc006480918442bb826fa4282e /gpsd.c
parent7e93ba6775e0cee67896f01c25611dc6356934fd (diff)
downloadgpsd-a00d0c4bf92866317e777648d2624961aa76f9a2.tar.gz
Stelian Pop's fix for the J command handling.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/gpsd.c b/gpsd.c
index 3b37b458..b23123a5 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -749,22 +749,15 @@ static int handle_gpsd_request(int cfd, char *buf, int buflen)
(void)strlcpy(phrase, ",I=?", BUFSIZ);
break;
case 'J':
- if (!assign_channel(whoami) || whoami->device->device_type == NULL)
- (void)strlcpy(phrase, ",J=?", BUFSIZ);
- else if (privileged_user(whoami)) {
- if (*p == '=') ++p;
- if (*p == '1' || *p == '+') {
- whoami->buffer_policy = nocasoc;
- p++;
- } else if (*p == '0' || *p == '-') {
- whoami->buffer_policy = casoc;
- p++;
- }
+ if (*p == '=') ++p;
+ if (*p == '1' || *p == '+') {
+ whoami->buffer_policy = nocasoc;
+ p++;
+ } else if (*p == '0' || *p == '-') {
+ whoami->buffer_policy = casoc;
+ p++;
}
- if (!whoami->device)
- (void)snprintf(phrase, sizeof(phrase), ",J=?");
- else
- (void)snprintf(phrase, sizeof(phrase), ",J=%u", whoami->buffer_policy);
+ (void)snprintf(phrase, sizeof(phrase), ",J=%u", whoami->buffer_policy);
break;
case 'K':
for (j = i = 0; i < MAXDEVICES; i++)