From 9726ba11a79f3d2d1e616e12ef0bb44e4fc5cd20 Mon Sep 17 00:00:00 2001 From: zff Date: Tue, 28 Sep 2021 15:03:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=AD=E6=96=AD=E4=B8=AD=E8=B0=83?= =?UTF-8?q?=E7=94=A8PRINTK=E6=A6=82=E7=8E=87=E5=8D=A1=E6=AD=BB=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=B3=BB=E7=BB=9F=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=93=8D=E5=BA=94=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当console层的打印缓冲buffer满且打印任务被饿死时,函数ConsoleOutput会出现在for循环中 不退出的情况,导致中断打印时卡死 close: #I4C9GC Signed-off-by: zff Change-Id: I70b9d7c848dce7d351c5679e7b08049df27a6f10 --- kernel/common/los_printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/common/los_printf.c b/kernel/common/los_printf.c index 98d0eb26..fa0d57d2 100644 --- a/kernel/common/los_printf.c +++ b/kernel/common/los_printf.c @@ -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) && (OS_INT_ACTIVE)) || (toWrite == cnt)) { break; } writen += cnt; -- GitLab