summaryrefslogtreecommitdiff
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
commit42639f66caf241cdd83882db7c44079aa4ad2e5b (patch)
tree8eac0c1127119043ec7aff1274d481e8da9580a3 /gdb/ser-unix.c
parentbd87795137ebd3ea3c258fac525a923a7a050f93 (diff)
downloadgdb-42639f66caf241cdd83882db7c44079aa4ad2e5b.tar.gz
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 5a1ec1dc14f..73555b27a0a 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. */