summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-29 12:36:35 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-03-29 12:36:35 -0400
commitfca283a87a6a9d8c8e0f6341e1e16d026f1196c5 (patch)
treed4b9fac3537f96063c8ce92f6ac26f714bf859f9 /gpsd.c
parentd38529f8dc21e60f8095094e00a9136178037717 (diff)
downloadgpsd-fca283a87a6a9d8c8e0f6341e1e16d026f1196c5.tar.gz
Another step towards complete conditionalizing on FORCE_NOWAIT.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gpsd.c b/gpsd.c
index 9efc0011..876bccfe 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -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;