projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff9f22f
)
(generic_readchar): Tweak previous checkin, close error_fd if EOF.
author
Doug Evans
<dje@google.com>
Tue, 20 Apr 2010 06:06:38 +0000
(06:06 +0000)
committer
Doug Evans
<dje@google.com>
Tue, 20 Apr 2010 06:06:38 +0000
(06:06 +0000)
gdb/ser-base.c
patch
|
blob
|
history
diff --git
a/gdb/ser-base.c
b/gdb/ser-base.c
index 7afd1ee1c8c18f4cf1f426acacfd047e2e91b989..6285342e7c2cd84a6b8efe4ecdcda76af5454d37 100644
(file)
--- a/
gdb/ser-base.c
+++ b/
gdb/ser-base.c
@@
-361,8
+361,15
@@
generic_readchar (struct serial *scb, int timeout,
break;
s = read (scb->error_fd, &buf, to_read);
- if (s
<= 0
)
+ if (s
== -1
)
break;
+ if (s == 0)
+ {
+ /* EOF */
+ close (scb->error_fd);
+ scb->error_fd = -1;
+ break;
+ }
/* In theory, embedded newlines are not a problem.
But for MI, we want each output line to have just