aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-go32.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ser-go32.c')
-rw-r--r--gdb/ser-go32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index 24c55f2..cbfb27f 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -160,12 +160,14 @@ dos_async_rx ()
}
rv = *aptr (async->getp++);
+
if (async->getp >= async->buffer_end)
async->getp = async->buffer_start;
return rv;
}
+
static int
dosasync_read (fd, buf, len, timeout)
int fd;
@@ -186,7 +188,7 @@ dosasync_read (fd, buf, len, timeout)
while (!dos_async_ready ())
{
time (&now);
- if (now >= then)
+ if (now >= then && timeout > 0)
return i;
}
}
@@ -258,6 +260,7 @@ go32_readchar (scb, timeout)
{
char buf;
+
/* Shortcut for polling */
if (timeout == 0)
{