diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-10-25 13:18:09 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-10-25 13:18:09 +0000 |
commit | a00d0c4bf92866317e777648d2624961aa76f9a2 (patch) | |
tree | af1e36ad73fe86cc006480918442bb826fa4282e /gpsd.c | |
parent | 7e93ba6775e0cee67896f01c25611dc6356934fd (diff) | |
download | gpsd-a00d0c4bf92866317e777648d2624961aa76f9a2.tar.gz |
Stelian Pop's fix for the J command handling.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -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++) |