summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2004-08-15 20:18:45 +0000
committerEric S. Raymond <esr@thyrsus.com>2004-08-15 20:18:45 +0000
commitb2252400bd5438c8ab012830ed67f77b933a46a7 (patch)
treee4d518cbb0c38cc63fa380fffa8aca970346e424
parent53db08f18117105481a07b43db64fed7ced2b662 (diff)
downloadgpsd-b2252400bd5438c8ab012830ed67f77b933a46a7.tar.gz
Merge -n support back in.
-rw-r--r--gpsd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 4abd5af9..9a2cdc6b 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -394,7 +394,7 @@ static void raw_hook(char *sentence)
#define PUBLISH(fd, cmds) handle_request(fd, cmds, sizeof(cmds)-1)
if (strncmp(GPRMC, sentence, 5) == 0) {
- ok = PUBLISH(fd, "");
+ ok = PUBLISH(fd, "pvs");
} else if (strncmp(GPGGA, sentence, 5) == 0) {
ok = PUBLISH(fd, "sa");
} else if (strncmp(GPGLL, sentence, 5) == 0) {
@@ -434,9 +434,10 @@ int main(int argc, char *argv[])
char gpstype = 'n', *colon;
int fd;
int need_gps;
+ int nowait = 0;
session.debug = 1;
- while ((option = getopt(argc, argv, "D:S:T:hi:p:d:t:")) != -1) {
+ while ((option = getopt(argc, argv, "D:S:T:hi:np:d:t:")) != -1) {
switch (option) {
case 'T':
gpstype = *optarg;
@@ -470,6 +471,9 @@ int main(int argc, char *argv[])
session.initpos.longitude[strlen(session.initpos.longitude)-1] = '\0';
}
break;
+ case 'n':
+ nowait = 1;
+ break;
case 'p':
device_name = optarg;
break;
@@ -523,7 +527,7 @@ int main(int argc, char *argv[])
if (session.dsock >= 0)
FD_SET(session.dsock, &afds);
- if (gps_activate(&session) < 0)
+ if (nowait && (gps_activate(&session) < 0))
gpscli_errexit("exiting - GPS device nonexistent or can't be read");
while (1) {