diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2012-09-22 08:59:54 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-09-22 09:01:42 -0400 |
commit | 7b7806b85096391e364a03ef3551970620b5492e (patch) | |
tree | ce5416a3f49a79e941e93197c31bdc917ec45d82 /libgps_core.c | |
parent | 00b768d7ec851a5cff99d5a6ac169e789438001f (diff) | |
download | gpsd-7b7806b85096391e364a03ef3551970620b5492e.tar.gz |
Lose the assumption that socket_t is an integer.
Diffstat (limited to 'libgps_core.c')
-rw-r--r-- | libgps_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgps_core.c b/libgps_core.c index 3f91ee68..855154fd 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -110,7 +110,7 @@ int gps_close(struct gps_data_t *gpsdata) libgps_debug_trace((DEBUG_CALLS, "gps_close()\n")); #ifdef SHM_EXPORT_ENABLE - if ((intptr_t)(gpsdata->gps_fd) == -1) { + if (BAD_SOCKET((intptr_t)(gpsdata->gps_fd))) { gps_shm_close(gpsdata); status = 0; } @@ -134,13 +134,13 @@ int gps_read(struct gps_data_t *gpsdata) /*@ -usedef -compdef -uniondef @*/ #ifdef SHM_EXPORT_ENABLE - if ((intptr_t)(gpsdata->gps_fd) == -1) { + if (BAD_SOCKET((intptr_t)(gpsdata->gps_fd))) { status = gps_shm_read(gpsdata); } #endif /* SHM_EXPORT_ENABLE */ #ifdef SOCKET_EXPORT_ENABLE - if (status == -1 && (intptr_t)(gpsdata->gps_fd) != -1) { + if (status == -1 && BAD_SOCKET((intptr_t)(gpsdata->gps_fd))) { status = gps_sock_read(gpsdata); } #endif /* SOCKET_EXPORT_ENABLE */ |