aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-04 16:43:18 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-04 16:43:18 +0100
commit06b114900fc57cac0e422d26228f4d0aaf5d2288 (patch)
treef8c0aea330b697bb2a1e86833091b5c76407c954
parent834aba3b72cb0e45153b95fed991522f7f1986c9 (diff)
downloadbusybox-w32-06b114900fc57cac0e422d26228f4d0aaf5d2288.tar.gz
busybox-w32-06b114900fc57cac0e422d26228f4d0aaf5d2288.tar.bz2
busybox-w32-06b114900fc57cac0e422d26228f4d0aaf5d2288.zip
ash: fix "duplicate local" code (forgot to re-enable interrupts)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index f75642868..87f2127a1 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -32,6 +32,7 @@
32#define DEBUG_TIME 0 32#define DEBUG_TIME 0
33#define DEBUG_PID 1 33#define DEBUG_PID 1
34#define DEBUG_SIG 1 34#define DEBUG_SIG 1
35#define DEBUG_INTONOFF 0
35 36
36#define PROFILE 0 37#define PROFILE 0
37 38
@@ -442,10 +443,18 @@ static void exitshell(void) NORETURN;
442 * much more efficient and portable. (But hacking the kernel is so much 443 * much more efficient and portable. (But hacking the kernel is so much
443 * more fun than worrying about efficiency and portability. :-)) 444 * more fun than worrying about efficiency and portability. :-))
444 */ 445 */
445#define INT_OFF do { \ 446#if DEBUG_INTONOFF
447# define INT_OFF do { \
448 TRACE(("%s:%d INT_OFF(%d)\n", __func__, __LINE__, suppress_int)); \
446 suppress_int++; \ 449 suppress_int++; \
447 barrier(); \ 450 barrier(); \
448} while (0) 451} while (0)
452#else
453# define INT_OFF do { \
454 suppress_int++; \
455 barrier(); \
456} while (0)
457#endif
449 458
450/* 459/*
451 * Called to raise an exception. Since C doesn't include exceptions, we 460 * Called to raise an exception. Since C doesn't include exceptions, we
@@ -513,7 +522,14 @@ int_on(void)
513 raise_interrupt(); 522 raise_interrupt();
514 } 523 }
515} 524}
516#define INT_ON int_on() 525#if DEBUG_INTONOFF
526# define INT_ON do { \
527 TRACE(("%s:%d INT_ON(%d)\n", __func__, __LINE__, suppress_int-1)); \
528 int_on(); \
529} while (0)
530#else
531# define INT_ON int_on()
532#endif
517static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void 533static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void
518force_int_on(void) 534force_int_on(void)
519{ 535{
@@ -9101,7 +9117,7 @@ mklocal(char *name)
9101 /* else: 9117 /* else:
9102 * it's a duplicate "local VAR" declaration, do nothing 9118 * it's a duplicate "local VAR" declaration, do nothing
9103 */ 9119 */
9104 return; 9120 goto ret;
9105 } 9121 }
9106 lvp = lvp->next; 9122 lvp = lvp->next;
9107 } 9123 }
@@ -9140,6 +9156,7 @@ mklocal(char *name)
9140 lvp->vp = vp; 9156 lvp->vp = vp;
9141 lvp->next = localvars; 9157 lvp->next = localvars;
9142 localvars = lvp; 9158 localvars = lvp;
9159 ret:
9143 INT_ON; 9160 INT_ON;
9144} 9161}
9145 9162