mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Bug #27964: pthread_key_create doesn't set errno, so don't report \
errno Vasil Dimov (at Oracle) noted that pthread_key_create() does not set errno, so if it fails then we return the wrong error code. Instead, capture the return value, which is the real error value, and instead report that.
This commit is contained in:
@ -79,11 +79,12 @@ static uint get_thread_lib(void);
|
||||
|
||||
my_bool my_thread_global_init(void)
|
||||
{
|
||||
int pth_ret;
|
||||
thd_lib_detected= get_thread_lib();
|
||||
|
||||
if (pthread_key_create(&THR_KEY_mysys,0))
|
||||
if (pth_ret= pthread_key_create(&THR_KEY_mysys, NULL))
|
||||
{
|
||||
fprintf(stderr,"Can't initialize threads: error %d\n",errno);
|
||||
fprintf(stderr,"Can't initialize threads: pthread error %d\n", pth_ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user