summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-30 18:30:29 +0100
committerDenys Vlasenko2016-10-30 18:30:29 +0100
commit474ed06c3939391cbfd7b70bf4960403ae166762 (patch)
tree919267e0c24c7e1d08cbb9389694e571f330d6cf /shell
parent493b9cae808093ff5d89b5fb794e3991859e7df6 (diff)
downloadbusybox-474ed06c3939391cbfd7b70bf4960403ae166762.zip
busybox-474ed06c3939391cbfd7b70bf4960403ae166762.tar.gz
ash: fix bit-rotten debug infrastructure
DEBUG = 2 output was a bit messed up Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0c84805..d617168 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -844,13 +844,8 @@ trace_vprintf(const char *fmt, va_list va)
{
if (debug != 1)
return;
- if (DEBUG_TIME)
- fprintf(tracefile, "%u ", (int) time(NULL));
- if (DEBUG_PID)
- fprintf(tracefile, "[%u] ", (int) getpid());
- if (DEBUG_SIG)
- fprintf(tracefile, "pending s:%d i:%d(supp:%d) ", pending_sig, pending_int, suppress_int);
vfprintf(tracefile, fmt, va);
+ fprintf(tracefile, "\n");
}
static void
@@ -1243,11 +1238,10 @@ ash_vmsg_and_raise(int cond, const char *msg, va_list ap)
{
#if DEBUG
if (msg) {
- TRACE(("ash_vmsg_and_raise(%d, \"", cond));
+ TRACE(("ash_vmsg_and_raise(%d):", cond));
TRACEV((msg, ap));
- TRACE(("\") pid=%d\n", getpid()));
} else
- TRACE(("ash_vmsg_and_raise(%d, NULL) pid=%d\n", cond, getpid()));
+ TRACE(("ash_vmsg_and_raise(%d):NULL\n", cond));
if (msg)
#endif
ash_vmsg(msg, ap);
@@ -13422,16 +13416,15 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
goto state4;
}
exception_handler = &jmploc;
-#if DEBUG
- opentrace();
- TRACE(("Shell args: "));
- trace_puts_args(argv);
-#endif
rootpid = getpid();
init();
setstackmark(&smark);
procargs(argv);
+#if DEBUG
+ TRACE(("Shell args: "));
+ trace_puts_args(argv);
+#endif
if (argv[0] && argv[0][0] == '-')
isloginsh = 1;