diff options
author | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-11-12 08:27:51 +0000 |
commit | ead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch) | |
tree | af268270382dad969218063d4a8120fc91a9e631 /libbb/appletlib.c | |
parent | 567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff) | |
parent | 64981b4c8e88812c322bee3832f1d421ff670ed5 (diff) | |
download | busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2 busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 77a9c3b7d..6ed86e12b 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -25,6 +25,11 @@ | |||
25 | * | 25 | * |
26 | * FEATURE_INSTALLER or FEATURE_SUID will still link printf routines in. :( | 26 | * FEATURE_INSTALLER or FEATURE_SUID will still link printf routines in. :( |
27 | */ | 27 | */ |
28 | |||
29 | /* Define this accessor before we #define "errno" our way */ | ||
30 | #include <errno.h> | ||
31 | static inline int *get_perrno(void) { return &errno; } | ||
32 | |||
28 | #include "busybox.h" | 33 | #include "busybox.h" |
29 | 34 | ||
30 | #if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ | 35 | #if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ |
@@ -318,8 +323,8 @@ void lbb_prepare(const char *applet | |||
318 | void lbb_prepare(const char *applet | 323 | void lbb_prepare(const char *applet |
319 | IF_FEATURE_INDIVIDUAL(, char **argv)) | 324 | IF_FEATURE_INDIVIDUAL(, char **argv)) |
320 | { | 325 | { |
321 | #ifdef __GLIBC__ | 326 | #ifdef bb_cached_errno_ptr |
322 | (*(int **)not_const_pp(&bb_errno)) = __errno_location(); | 327 | (*(int **)not_const_pp(&bb_errno)) = get_perrno(); |
323 | barrier(); | 328 | barrier(); |
324 | #endif | 329 | #endif |
325 | applet_name = applet; | 330 | applet_name = applet; |