From 864df7e6f35f352b139061a7d0546c002067e507 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Sat, 22 Jan 1994 19:16:02 +0000 Subject: * 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]. --- gdb/ser-unix.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'gdb/ser-unix.c') 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; -- cgit v1.1