summaryrefslogtreecommitdiff
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-04 15:43:18 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2016-11-04 15:43:18 (GMT)
commit06b114900fc57cac0e422d26228f4d0aaf5d2288 (patch)
treef8c0aea330b697bb2a1e86833091b5c76407c954
parent834aba3b72cb0e45153b95fed991522f7f1986c9 (diff)
downloadbusybox-06b114900fc57cac0e422d26228f4d0aaf5d2288.zip
busybox-06b114900fc57cac0e422d26228f4d0aaf5d2288.tar.gz
busybox-06b114900fc57cac0e422d26228f4d0aaf5d2288.tar.bz2
ash: fix "duplicate local" code (forgot to re-enable interrupts)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat
-rw-r--r--shell/ash.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index f756428..87f2127 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -32,6 +32,7 @@
#define DEBUG_TIME 0
#define DEBUG_PID 1
#define DEBUG_SIG 1
+#define DEBUG_INTONOFF 0
#define PROFILE 0
@@ -442,10 +443,18 @@ static void exitshell(void) NORETURN;
* much more efficient and portable. (But hacking the kernel is so much
* more fun than worrying about efficiency and portability. :-))
*/
-#define INT_OFF do { \
+#if DEBUG_INTONOFF
+# define INT_OFF do { \
+ TRACE(("%s:%d INT_OFF(%d)\n", __func__, __LINE__, suppress_int)); \
suppress_int++; \
barrier(); \
} while (0)
+#else
+# define INT_OFF do { \
+ suppress_int++; \
+ barrier(); \
+} while (0)
+#endif
/*
* Called to raise an exception. Since C doesn't include exceptions, we
@@ -513,7 +522,14 @@ int_on(void)
raise_interrupt();
}
}
-#define INT_ON int_on()
+#if DEBUG_INTONOFF
+# define INT_ON do { \
+ TRACE(("%s:%d INT_ON(%d)\n", __func__, __LINE__, suppress_int-1)); \
+ int_on(); \
+} while (0)
+#else
+# define INT_ON int_on()
+#endif
static IF_ASH_OPTIMIZE_FOR_SIZE(inline) void
force_int_on(void)
{
@@ -9101,7 +9117,7 @@ mklocal(char *name)
/* else:
* it's a duplicate "local VAR" declaration, do nothing
*/
- return;
+ goto ret;
}
lvp = lvp->next;
}
@@ -9140,6 +9156,7 @@ mklocal(char *name)
lvp->vp = vp;
lvp->next = localvars;
localvars = lvp;
+ ret:
INT_ON;
}