diff --git a/kernel/common/los_printf.c b/kernel/common/los_printf.c index e5d0b774..8d55bb9f 100644 --- a/kernel/common/los_printf.c +++ b/kernel/common/los_printf.c @@ -47,6 +47,7 @@ #include "los_excinfo_pri.h" #endif #include "los_exc_pri.h" +#include "los_sched_pri.h" #define SIZEBUF 256 @@ -94,7 +95,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len) for (;;) { cnt = write(STDOUT_FILENO, str + written, (size_t)toWrite); - if ((cnt < 0) || ((cnt == 0) && (OS_INT_ACTIVE)) || (toWrite == cnt)) { + if ((cnt < 0) || ((cnt == 0) && ((!OsPreemptable()) || (OS_INT_ACTIVE))) || (toWrite == cnt)) { break; } written += cnt;