From 2f858283f18ccf065431459e0d289ab50b9bd0c7 Mon Sep 17 00:00:00 2001 From: Kelvin Lawson Date: Sun, 20 Mar 2016 22:00:48 +0000 Subject: [PATCH] ARM port reentrancy: Close per-thread stdout when runs to completion. --- ports/arm/atomport.c | 1 + ports/arm/syscalls.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/arm/atomport.c b/ports/arm/atomport.c index 56e2137..3154fa7 100644 --- a/ports/arm/atomport.c +++ b/ports/arm/atomport.c @@ -92,6 +92,7 @@ static void thread_shell (void) } /* Clean up after thread completion */ + fclose (stdout); _reclaim_reent (&(curr_tcb->port_priv.reent)); /* Thread has run to completion: remove it from the ready list */ diff --git a/ports/arm/syscalls.c b/ports/arm/syscalls.c index d89ba02..4bbf956 100644 --- a/ports/arm/syscalls.c +++ b/ports/arm/syscalls.c @@ -76,7 +76,7 @@ extern int _exit(int val) __attribute__((weak)); */ int _close(int file) { - return -1; + return 0; }