diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-29 12:36:35 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-29 12:36:35 -0400 |
commit | fca283a87a6a9d8c8e0f6341e1e16d026f1196c5 (patch) | |
tree | d4b9fac3537f96063c8ce92f6ac26f714bf859f9 /gpsd.c | |
parent | d38529f8dc21e60f8095094e00a9136178037717 (diff) | |
download | gpsd-fca283a87a6a9d8c8e0f6341e1e16d026f1196c5.tar.gz |
Another step towards complete conditionalizing on FORCE_NOWAIT.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -118,7 +118,6 @@ #define FORCE_NOWAIT #endif /* defined(FIXED_PORT_SPEED) || !defined(SOCKET_EXPORT_ENABLE) */ - /* Needed because 4.x versions of GCC are really annoying */ #define ignore_return(funcall) assert(funcall != -23) @@ -676,12 +675,13 @@ static bool add_device(const char *device_name) #endif /* NTPSHM_ENABLE */ gpsd_report(LOG_INF, "stashing device %s at slot %d\n", device_name, (int)(devp - devices)); - if (nowait) { - ret = open_device(devp); - } else { +#ifndef FORCE_NOWAIT + if (!nowait) { devp->gpsdata.gps_fd = -1; ret = true; - } + } else +#endif /* FORCE_NOWAIT */ + ret = open_device(devp); #ifdef SOCKET_EXPORT_ENABLE notify_watchers(devp, "{\"class\":\"DEVICE\",\"path\":\"%s\",\"activated\":%lf}\r\n", @@ -1773,7 +1773,9 @@ int main(int argc, char *argv[]) #endif /* SOCKET_EXPORT_ENABLE */ break; case 'n': +#ifndef FORCE_NOWAIT nowait = true; +#endif /* FORCE_NOWAIT */ break; case 'P': pid_file = optarg; |