aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-unix.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-22 19:16:02 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-22 19:16:02 +0000
commit864df7e6f35f352b139061a7d0546c002067e507 (patch)
tree2003713749acd81e391d78bd76fc9bc76e4076b2 /gdb/ser-unix.c
parent08f74b9271bc22a0e0a55707f18b23778d25be1e (diff)
downloadfsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.zip
fsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.tar.gz
fsf-binutils-gdb-864df7e6f35f352b139061a7d0546c002067e507.tar.bz2
* remote-mips.c (mips_initialize): Clear mips_initializing via
cleanup chain, not directly. * ser-unix.c (wait_for) [HAVE_TERMIO, HAVE_TERMIOS]: Make a timeout of -1 mean forever, like in the HAVE_SGTTY case. Warn if we are munging the timeout due to the limited range of c_cc[VTIME].
Diffstat (limited to 'gdb/ser-unix.c')
-rw-r--r--gdb/ser-unix.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index d14a996..0e490fb 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -435,11 +435,41 @@ wait_for(scb, timeout)
fprintf_unfiltered(gdb_stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
#ifdef HAVE_TERMIOS
- state.termios.c_cc[VTIME] = timeout * 10;
+ if (timeout < 0)
+ {
+ /* No timeout. */
+ state.termios.c_cc[VTIME] = 0;
+ state.termios.c_cc[VMIN] = 1;
+ }
+ else
+ {
+ state.termios.c_cc[VMIN] = 0;
+ state.termios.c_cc[VTIME] = timeout * 10;
+ if (state.termios.c_cc[VTIME] != timeout * 10)
+ {
+ warning ("Timeout value %d too large, using %d", timeout,
+ state.termios.c_cc[VTIME] / 10);
+ }
+ }
#endif
#ifdef HAVE_TERMIO
- state.termio.c_cc[VTIME] = timeout * 10;
+ if (timeout < 0)
+ {
+ /* No timeout. */
+ state.termio.c_cc[VTIME] = 0;
+ state.termio.c_cc[VMIN] = 1;
+ }
+ else
+ {
+ state.termio.c_cc[VMIN] = 0;
+ state.termio.c_cc[VTIME] = timeout * 10;
+ if (state.termio.c_cc[VTIME] != timeout * 10)
+ {
+ warning ("Timeout value %d too large, using %d", timeout,
+ state.termio.c_cc[VTIME] / 10);
+ }
+ }
#endif
scb->current_timeout = timeout;