summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2005-08-18 18:56:43 +0000
committerGary E. Miller <gem@rellim.com>2005-08-18 18:56:43 +0000
commit808003d756911fc6985c97e4fe42c93293722160 (patch)
tree72191388e465ac91f6cf7c95cbe8ae817edd15a2 /cgps.c
parent3e618180e62bfb7e4d4b79df325ed00e1fc67841 (diff)
downloadgpsd-808003d756911fc6985c97e4fe42c93293722160.tar.gz
fix ^c and (q)uit.
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/cgps.c b/cgps.c
index 7c85910c..1323447b 100644
--- a/cgps.c
+++ b/cgps.c
@@ -63,7 +63,6 @@ static void die(int sig UNUSED)
/* Put input attributes back the way they were. */
(void)echo();
- (void)noraw();
/* Done with curses. */
(void)endwin();
@@ -251,6 +250,7 @@ int main(int argc, char *argv[])
int option;
char *arg = NULL, *colon1, *colon2, *device = NULL, *server = NULL, *port = DEFAULT_GPSD_PORT;
char *err_str = NULL;
+ char c;
struct timeval timeout;
fd_set rfds;
@@ -346,8 +346,8 @@ int main(int argc, char *argv[])
/* Set up the curses screen (if using curses). */
(void)initscr();
- (void)raw();
(void)noecho();
+ (void)nodelay(stdscr,TRUE);
(void)signal(SIGINT,die);
/* Here's where updates go. */
@@ -396,6 +396,14 @@ int main(int argc, char *argv[])
fprintf(stderr, "cgps: No data\n");
}
}
- //die(0);
+
+ /* Check for user input. */
+ c=getch();
+
+ /* Quit if 'q'. */
+ if(c=='q') {
+ die(NULL);
+ }
+
}