diff --git a/kernel/common/los_printf.c b/kernel/common/los_printf.c index e5d0b7745ce3d15443e019e4b464bbd0fcec4b04..8d55bb9fba495840326856975b565f03ce0c56a1 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;