aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-unix.c
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2000-09-15 20:40:15 +0000
committerFernando Nasser <fnasser@redhat.com>2000-09-15 20:40:15 +0000
commitf7c9d7b6986678dc1be12199492d97ff2624c2d8 (patch)
treecfea50c29f66d55e2ad1cff049091bbef17e7d78 /gdb/ser-unix.c
parent0752970ef843fa6a9e7ac8bb5a30608eded7f228 (diff)
downloadgdb-f7c9d7b6986678dc1be12199492d97ff2624c2d8.zip
gdb-f7c9d7b6986678dc1be12199492d97ff2624c2d8.tar.gz
gdb-f7c9d7b6986678dc1be12199492d97ff2624c2d8.tar.bz2
2000-09-15 Fernando Nasser <fnasser@cygnus.com>
* ser-unix.c (do_unix_readchar): Prevent infinite read wait to be interrupted after 32K seconds.
Diffstat (limited to 'gdb/ser-unix.c')
-rw-r--r--gdb/ser-unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 5a1ec1d..73555b2 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -927,7 +927,7 @@ do_unix_readchar (serial_t scb, int timeout)
}
status = ser_unix_wait_for (scb, delta);
- timeout -= delta;
+ timeout = (timeout <= 0) ? timeout : (timeout - delta);
/* If we got a character or an error back from wait_for, then we can
break from the loop before the timeout is completed. */