target/semihosting: Fix of close(): Never close standard streams
authorJan Matyas <matyas@codasip.com>
Fri, 4 Jun 2021 08:44:44 +0000 (10:44 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 10 Jul 2021 14:29:58 +0000 (15:29 +0100)
commit6f439e203289c517360fdc061ca9497fc4c530b8
tree1d15c296d3d47276fc11f5aae4714204fa33e943
parent4487270ea434782f25f790892c5f7d03b7cbe243
target/semihosting: Fix of close(): Never close standard streams

This change fixes behavior of the SEMIHOSTING_SYS_CLOSE operation.
It ensures that OpenOCD's own stdin/stdout/stderr streams are never
closed, not even if the target requests it via semihosting.

Change-Id: Ia85af5963d1a3516284fd834f7197369a8fb268c
Signed-off-by: Jan Matyas <matyas@codasip.com>
Reviewed-on: http://openocd.zylin.com/6291
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/semihosting_common.c