aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c2
-rw-r--r--libbb/ptr_to_globals.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index a515c3fe3..717c63649 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -303,7 +303,7 @@ void lbb_prepare(const char *applet
void lbb_prepare(const char *applet
IF_FEATURE_INDIVIDUAL(, char **argv))
{
-#ifdef __GLIBC__
+#ifdef bb_cached_errno_ptr
(*(int **)not_const_pp(&bb_errno)) = __errno_location();
barrier();
#endif
diff --git a/libbb/ptr_to_globals.c b/libbb/ptr_to_globals.c
index 8ba9cd154..2232c6864 100644
--- a/libbb/ptr_to_globals.c
+++ b/libbb/ptr_to_globals.c
@@ -14,7 +14,7 @@ struct globals;
* but here we make it live in R/W memory */
struct globals *ptr_to_globals;
-#ifdef __GLIBC__
+#ifdef errno
int *bb_errno;
#endif
@@ -27,7 +27,7 @@ int *bb_errno;
* on weird architectures, compilers, linkers and so on */
struct globals *const ptr_to_globals __attribute__ ((section (".data")));
-#ifdef __GLIBC__
+#ifdef errno
int *const bb_errno __attribute__ ((section (".data")));
#endif