aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-base.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-04-20 05:52:07 +0000
committerDoug Evans <dje@google.com>2010-04-20 05:52:07 +0000
commitff9f22f1a739cacfec1ab2be3a51ddeccb9fd9c4 (patch)
treec81335d0e6fe04936e6fc6eda96d235906554add /gdb/ser-base.c
parent3436961f292f044c6c9b44cf6e9b8716539b130f (diff)
downloadgdb-ff9f22f1a739cacfec1ab2be3a51ddeccb9fd9c4.zip
gdb-ff9f22f1a739cacfec1ab2be3a51ddeccb9fd9c4.tar.gz
gdb-ff9f22f1a739cacfec1ab2be3a51ddeccb9fd9c4.tar.bz2
* ser-base.c (generic_readchar): Watch for EOF in read of error_fd.
* ser-pipe.c (pipe_open): Fix file descriptor leaks. (pipe_close): Ditto.
Diffstat (limited to 'gdb/ser-base.c')
-rw-r--r--gdb/ser-base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index e399b77..7afd1ee 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -361,7 +361,7 @@ generic_readchar (struct serial *scb, int timeout,
break;
s = read (scb->error_fd, &buf, to_read);
- if (s == -1)
+ if (s <= 0)
break;
/* In theory, embedded newlines are not a problem.