This is an automated email from Gerrit.

Serem Balut (hogth...@users.sourceforge.net) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5127

-- gerrit

commit f6f098a6b309527604d64cff9a0156dbf825c285
Author: hogthrob <hogth...@users.sourceforge.net>
Date:   Mon Apr 22 13:10:13 2019 +0200

    Fixed wrong number of read bytes return for short read with 
semihosting_fileio
    
    The implementation worked only for reads returning exactly the requested 
amount OR EOF/ERROR.
    In the case of "not full" read, the number of requested bytes - returned 
bytes was returned,
    which should have been the number of read bytes.
    
    Change-Id: I6dc8bb4c68ead453c237a379367e13b43db65291
    Signed-off-by: hogthrob <hogth...@users.sourceforge.net>

diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c
index 5920789..f5d6887 100644
--- a/src/target/semihosting_common.c
+++ b/src/target/semihosting_common.c
@@ -1393,6 +1393,8 @@ static int semihosting_common_fileio_end(struct target 
*target, int result,
                                semihosting->result = 0;
                        if (result <= 0)
                                semihosting->result = fileio_info->param_3;
+                        if (result > 0)
+                                semihosting->result = fileio_info->param_3 - 
result;
                        break;
 
                case SEMIHOSTING_SYS_SEEK:      /* 0x0a */

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to