From 357876052b125dcd74882f61afec19d8f519074c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 6 Aug 2011 20:20:23 -0400 Subject: simplify multi-threaded errno, eliminate useless function pointer --- src/errno/__errno_location.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/errno') diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c index a0185780..3e92d7c7 100644 --- a/src/errno/__errno_location.c +++ b/src/errno/__errno_location.c @@ -1,9 +1,8 @@ -#include -#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; } -- cgit v1.2.1