mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
BUG/MINOR: thread: add a check for pthread_create
preload_libgcc_s() use pthread_create to create a thread and then call pthread_join to use it, but it doesn't check if the option is successful. So add a check to aviod potential crash.
This commit is contained in:
parent
15c3d20e31
commit
ef667b1ad8
@ -1066,7 +1066,7 @@ static void *dummy_thread_function(void *data)
|
|||||||
static inline void preload_libgcc_s(void)
|
static inline void preload_libgcc_s(void)
|
||||||
{
|
{
|
||||||
pthread_t dummy_thread;
|
pthread_t dummy_thread;
|
||||||
pthread_create(&dummy_thread, NULL, dummy_thread_function, NULL);
|
if (pthread_create(&dummy_thread, NULL, dummy_thread_function, NULL) == 0)
|
||||||
pthread_join(dummy_thread, NULL);
|
pthread_join(dummy_thread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user