simplify multi-threaded errno, eliminate useless function pointer
This commit is contained in:
parent
98acf04fc0
commit
357876052b
3 changed files with 5 additions and 12 deletions
|
|
@ -1,9 +1,8 @@
|
|||
#include <errno.h>
|
||||
#include "libc.h"
|
||||
#include "pthread_impl.h"
|
||||
|
||||
int *__errno_location(void)
|
||||
{
|
||||
static int e;
|
||||
if (libc.errno_location) return libc.errno_location();
|
||||
if (libc.main_thread) return __pthread_self()->errno_ptr;
|
||||
return &e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue