diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-02-25 20:02:16 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-02-25 20:02:16 +0000 |
commit | 95431d08b2de3a584eedf19cfa9b877b093eda96 (patch) | |
tree | e6aff5a5a89526a13ad3f039c2a7b794f5f8567b /gpsctl.c | |
parent | 4496cc6f97e2c8fec32d5b6a08f5dc5f962f8438 (diff) | |
download | gpsd-95431d08b2de3a584eedf19cfa9b877b093eda96.tar.gz |
Set readonly properly for gpsctl -e.
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -315,6 +315,9 @@ int main(int argc, char **argv) /*@ -mustfreeonly -immediatetrans @*/ session.context = &context; /* in case gps_init isn't called */ + if (echo) + context.readonly = true; + (void) alarm(timeout); (void) signal(SIGALRM, onsig); /* @@ -458,6 +461,8 @@ int main(int argc, char **argv) } /*@ -compdef @*/ if (control) { + bool write_enable = context.readonly; + context.readonly = false; if (session.device_type->control_send == NULL) { gpsd_report(LOG_ERROR, "%s devices have no control sender.\n", @@ -471,6 +476,7 @@ int main(int argc, char **argv) status = 1; } } + context.readonly = write_enable; } /*@ +compdef @*/ |