aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/applets/applets.c b/applets/applets.c
index e905ebec4..bd3704394 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -641,10 +641,19 @@ void run_applet_and_exit(const char *name, char **argv)
641} 641}
642 642
643 643
644#ifdef __GLIBC__
645/* Make it reside in R/W memory: */
646int *const bb_errno __attribute__ ((section (".data")));
647#endif
648
644int main(int argc, char **argv) 649int main(int argc, char **argv)
645{ 650{
646 const char *s; 651 const char *s;
647 652
653#ifdef __GLIBC__
654 (*(int **)&bb_errno) = __errno_location();
655#endif
656
648#if !BB_MMU 657#if !BB_MMU
649 /* NOMMU re-exec trick sets high-order bit in first byte of name */ 658 /* NOMMU re-exec trick sets high-order bit in first byte of name */
650 if (argv[0][0] & 0x80) { 659 if (argv[0][0] & 0x80) {