From 60e77d0ea7c41d291e40400eee86c2643f3f73a4 Mon Sep 17 00:00:00 2001 From: Harylee Date: Wed, 29 Dec 2021 11:55:31 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=86=85=E5=AD=98=E7=94=A8=E4=BE=8B=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=B3=BB=E7=BB=9F=E5=8D=A1=E6=AD=BB=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haryslee --- platform/los_printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/los_printf.c b/platform/los_printf.c index d71c3954..928b371b 100644 --- a/platform/los_printf.c +++ b/platform/los_printf.c @@ -46,7 +46,7 @@ #include "los_excinfo_pri.h" #endif #include "los_exc_pri.h" - +#include "los_sched_pri.h" #define SIZEBUF 256 @@ -94,7 +94,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len) for (;;) { cnt = write(STDOUT_FILENO, str + writen, (size_t)toWrite); - if ((cnt < 0) || (toWrite == cnt)) { + if ((cnt < 0) || ((cnt == 0) && ((!OsPreemptable()) || (OS_INT_ACTIVE))) || (toWrite == cnt)) { break; } writen += cnt;