fix: 修复重复执行内存用例导致系统卡死问题同步

Signed-off-by: Haryslee <lihao189@huawei.com>
This commit is contained in:
Harylee 2021-12-29 11:55:31 +00:00 committed by Gitee
parent 68b477588f
commit 60e77d0ea7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions

View File

@ -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;