simplify multi-threaded errno, eliminate useless function pointer

This commit is contained in:
Rich Felker 2011-08-06 20:20:23 -04:00
commit 357876052b
3 changed files with 5 additions and 12 deletions

View file

@ -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;
}