Fix issues reported by Coverity static analysis (#1974)

This commit is contained in:
Wenyong Huang
2023-02-22 11:10:21 +08:00
committed by GitHub
parent bb5629811f
commit 0fa0813a5a
5 changed files with 21 additions and 7 deletions

View File

@ -61,8 +61,9 @@ os_thread_create_with_prio(korp_tid *tid, thread_start_routine_t start,
pthread_attr_init(&tattr);
pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_JOINABLE);
if (pthread_attr_setstacksize(&tattr, stack_size) != 0) {
os_printf("Invalid thread stack size %u. Min stack size on Linux = %u",
stack_size, PTHREAD_STACK_MIN);
os_printf("Invalid thread stack size %u. "
"Min stack size on Linux = %u\n",
stack_size, (unsigned int)PTHREAD_STACK_MIN);
pthread_attr_destroy(&tattr);
return BHT_ERROR;
}