summaryrefslogtreecommitdiff
path: root/src/errno
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-21 23:00:52 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-21 23:00:52 -0500
commit71e6be641fb1e4080c2bb901e83423546d0ad5af (patch)
treed626e6f2356cb7dac46cdbc3b7685515972401df /src/errno
parent8cd48f0965c8b362ae21ec93528ba64a25a18b7f (diff)
downloadmusl-71e6be641fb1e4080c2bb901e83423546d0ad5af.tar.gz
musl-71e6be641fb1e4080c2bb901e83423546d0ad5af.tar.bz2
musl-71e6be641fb1e4080c2bb901e83423546d0ad5af.tar.xz
musl-71e6be641fb1e4080c2bb901e83423546d0ad5af.zip
change errno to static linkage (improves PIC code generation)
Diffstat (limited to 'src/errno')
-rw-r--r--src/errno/__errno_location.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c
index 0a220b63..a0185780 100644
--- a/src/errno/__errno_location.c
+++ b/src/errno/__errno_location.c
@@ -1,11 +1,9 @@
#include <errno.h>
#include "libc.h"
-#undef errno
-int errno;
-
int *__errno_location(void)
{
+ static int e;
if (libc.errno_location) return libc.errno_location();
- return &errno;
+ return &e;
}