summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-27 21:58:38 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-27 21:58:38 +0000
commitdde64ef97389884f0d79e48f39418d6bb51541b0 (patch)
tree25ef1c10075877adef38865ba1a3ea5b16e5fe2e
parent8ad0d158fce78a47c025ee08d0dc17d78a952ffd (diff)
downloadgpsd-dde64ef97389884f0d79e48f39418d6bb51541b0.tar.gz
Finish abstracting the channel primitives.
-rw-r--r--gpsd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 49da0a48..44a751c5 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -348,7 +348,7 @@ static /*@null@*/ struct gps_device_t *open_device(char *device_name,
struct gps_device_t **chp;
for (chp = channels; chp < channels + MAXDEVICES; chp++)
- if (!*chp)
+ if (!allocated_channel(*chp))
goto found;
return NULL;
found:
@@ -1211,7 +1211,7 @@ int main(int argc, char *argv[])
for (channel = channels; channel < channels + MAXDEVICES; channel++) {
struct gps_device_t *polldevice = *channel;
- if (!polldevice)
+ if (!allocated_channel(polldevice))
continue;
/* we may need to force the GPS open */
if (nowait && polldevice->gpsdata.gps_fd == -1) {
@@ -1287,7 +1287,7 @@ int main(int argc, char *argv[])
/* close devices with no remaining subscribers */
for (channel = channels; channel < channels + MAXDEVICES; channel++) {
- if (*channel) {
+ if (allocated_channel(*channel)) {
bool need_gps = false;
for (cfd = 0; cfd < FD_SETSIZE; cfd++)