diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-10-01 01:44:26 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-10-01 01:44:26 +0200 |
commit | aaa0709e7b39d0dc22ac92443a86c84eaff58679 (patch) | |
tree | 40504c5faddf67136d385b922b1462b0bbd50755 | |
parent | 841878e7eeb8861aa1b6f94436b8dcf3b064d1e4 (diff) | |
download | busybox-w32-aaa0709e7b39d0dc22ac92443a86c84eaff58679.tar.gz busybox-w32-aaa0709e7b39d0dc22ac92443a86c84eaff58679.tar.bz2 busybox-w32-aaa0709e7b39d0dc22ac92443a86c84eaff58679.zip |
libbb: do not open-code __errno_location() call
Thanks dalias!
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/appletlib.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 717c63649..5f59f1273 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__) \ |
@@ -304,7 +309,7 @@ void lbb_prepare(const char *applet | |||
304 | IF_FEATURE_INDIVIDUAL(, char **argv)) | 309 | IF_FEATURE_INDIVIDUAL(, char **argv)) |
305 | { | 310 | { |
306 | #ifdef bb_cached_errno_ptr | 311 | #ifdef bb_cached_errno_ptr |
307 | (*(int **)not_const_pp(&bb_errno)) = __errno_location(); | 312 | (*(int **)not_const_pp(&bb_errno)) = get_perrno(); |
308 | barrier(); | 313 | barrier(); |
309 | #endif | 314 | #endif |
310 | applet_name = applet; | 315 | applet_name = applet; |