提交 490390ed 编写于 作者: W wujing

fix: fix error checking pthread_join return value bug

On success, pthread_join() returns 0; on error, it returns an error
number(EDEADLK/EINVAL/EINVAL/ESRCH) which is a positive integer.
Signed-off-by: Nwujing <wujing50@huawei.com>
上级 4eeb13ae
......@@ -634,7 +634,7 @@ static int do_monitor_interval(const char *container_id, health_check_manager_t
ret = -1;
goto out;
}
if (pthread_join(exec_tid, NULL) < 0) {
if (pthread_join(exec_tid, NULL) != 0) {
ERROR("Failed to run health check thread");
ret = -1;
goto out;
......
......@@ -1707,7 +1707,7 @@ static void exec_container_end(container_exec_response *response, uint32_t cc, i
}
}
if (thread_id > 0) {
if (pthread_join(thread_id, NULL) < 0) {
if (pthread_join(thread_id, NULL) != 0) {
ERROR("Failed to join thread: %u", (unsigned int)thread_id);
}
}
......@@ -1860,4 +1860,4 @@ pack_response:
free_defs_process_user(puser);
return (cc == ISULAD_SUCCESS) ? 0 : -1;
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册