From d41ebd5d4581711edf913325b602d70dbf98bc51 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 12 Oct 2007 20:14:57 +0000 Subject: [PATCH] * serial.h (struct serial_ops): Document read_prim to return zero at EOF. * ser-base.c (do_ser_base_readchar): Return SERIAL_EOF when read_prim returns zero, not SERIAL_TIMEOUT. --- gdb/ChangeLog | 7 +++++++ gdb/ser-base.c | 4 +--- gdb/serial.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ed2abe59926..21d2bc4a5ba 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2007-10-12 Jim Blandy + + * serial.h (struct serial_ops): Document read_prim to return zero + at EOF. + * ser-base.c (do_ser_base_readchar): Return SERIAL_EOF when + read_prim returns zero, not SERIAL_TIMEOUT. + 2007-10-12 Ulrich Weigand * alpha-mdebug-tdep.c: Include "gdb_string.h". diff --git a/gdb/ser-base.c b/gdb/ser-base.c index f0f5b575dfb..8fdfd254611 100644 --- a/gdb/ser-base.c +++ b/gdb/ser-base.c @@ -279,9 +279,7 @@ do_ser_base_readchar (struct serial *scb, int timeout) if (status <= 0) { if (status == 0) - /* 0 chars means timeout. (We may need to distinguish between EOF - & timeouts someday.) */ - return SERIAL_TIMEOUT; + return SERIAL_EOF; else /* Got an error from read. */ return SERIAL_ERROR; diff --git a/gdb/serial.h b/gdb/serial.h index 1fc502b670e..426042999ac 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -244,7 +244,7 @@ struct serial_ops interesting. */ void (*async) (struct serial *scb, int async_p); /* Perform a low-level read operation, reading (at most) COUNT - bytes into SCB->BUF. */ + bytes into SCB->BUF. Return zero at end of file. */ int (*read_prim)(struct serial *scb, size_t count); /* Perform a low-level write operation, writing (at most) COUNT bytes from BUF. */ -- 2.30.2