diff options
author | Gary E. Miller <gem@rellim.com> | 2005-08-18 18:56:43 +0000 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2005-08-18 18:56:43 +0000 |
commit | 808003d756911fc6985c97e4fe42c93293722160 (patch) | |
tree | 72191388e465ac91f6cf7c95cbe8ae817edd15a2 /cgps.c | |
parent | 3e618180e62bfb7e4d4b79df325ed00e1fc67841 (diff) | |
download | gpsd-808003d756911fc6985c97e4fe42c93293722160.tar.gz |
fix ^c and (q)uit.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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); + } + } |