projects
/
fw
/
openocd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bef37ce
)
ARM semihosting: fix EOF handling with SYS_READ
author
Nicolas Pitre
<nico@fluxnic.net>
Tue, 2 Feb 2010 05:05:42 +0000
(
00:05
-0500)
committer
Nicolas Pitre
<nico@fluxnic.net>
Tue, 2 Feb 2010 05:05:42 +0000
(
00:05
-0500)
The semihosting interface has a strange convention for read/write where
the unused amount of buffer must be returned. We failed to return the
total buffer size when the local read() call returned 0.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
src/target/arm_semihosting.c
patch
|
blob
|
history
diff --git
a/src/target/arm_semihosting.c
b/src/target/arm_semihosting.c
index c41c5a0087f6fc5350b8ed1402a448c7f8836219..9b853d9f942d08da4fc29412238948ca6a09eaaa 100644
(file)
--- a/
src/target/arm_semihosting.c
+++ b/
src/target/arm_semihosting.c
@@
-190,7
+190,7
@@
static int do_semihosting(struct target *target)
} else {
result = read(fd, buf, l);
armv4_5->semihosting_errno = errno;
- if (result > 0) {
+ if (result >
=
0) {
retval = target_write_buffer(target, a, result, buf);
if (retval != ERROR_OK) {
free(buf);