diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-06-27 21:58:38 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-06-27 21:58:38 +0000 |
commit | dde64ef97389884f0d79e48f39418d6bb51541b0 (patch) | |
tree | 25ef1c10075877adef38865ba1a3ea5b16e5fe2e | |
parent | 8ad0d158fce78a47c025ee08d0dc17d78a952ffd (diff) | |
download | gpsd-dde64ef97389884f0d79e48f39418d6bb51541b0.tar.gz |
Finish abstracting the channel primitives.
-rw-r--r-- | gpsd.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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++) |