]> granicus.if.org Git - strace/commitdiff
defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 19 Feb 2019 02:50:25 +0000 (03:50 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 19 Feb 2019 19:14:31 +0000 (19:14 +0000)
This allows avoiding ifdefs sometimes.

* defs.h [!ENABLE_STACKTRACE] (stack_trace_enabled): Define as 0.
* strace.c (init): Remove #ifdef ENABLE_STACKTRACE around -c/-k check.

defs.h
strace.c

diff --git a/defs.h b/defs.h
index 53f30f26bc1d15e0bfd43271c0237ffd40264a3a..814b481b0c62648992ebbda758466e886b6380a3 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -418,6 +418,8 @@ extern unsigned followfork;
 # ifdef ENABLE_STACKTRACE
 /* if this is true do the stack trace for every system call */
 extern bool stack_trace_enabled;
+# else
+#  define stack_trace_enabled 0
 # endif
 extern unsigned ptrace_setoptions;
 extern unsigned max_strlen;
index ce89d5cdeec97a61dd479a107dd37862a9178835..b71ad05c12ea877f61a23fbc89da6dd9dd3ccadc 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -1748,10 +1748,8 @@ init(int argc, char *argv[])
        if (cflag == CFLAG_ONLY_STATS) {
                if (iflag)
                        error_msg("-%c has no effect with -c", 'i');
-#ifdef ENABLE_STACKTRACE
                if (stack_trace_enabled)
                        error_msg("-%c has no effect with -c", 'k');
-#endif
                if (rflag)
                        error_msg("-%c has no effect with -c", 'r');
                if (tflag)