errno: use staic errno to replace tl_errno before tls initialization
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
34397094d7
commit
d8ea482b58
@ -29,6 +29,12 @@
|
|||||||
|
|
||||||
#include <arch/tls.h>
|
#include <arch/tls.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static int g_errno;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -57,5 +63,5 @@ FAR int *__errno(void)
|
|||||||
|
|
||||||
/* And return the return refernce to the error number */
|
/* And return the return refernce to the error number */
|
||||||
|
|
||||||
return &tlsinfo->tl_errno;
|
return tlsinfo ? &tlsinfo->tl_errno : &g_errno;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user