From: Eugene Syromyatnikov Date: Tue, 19 Feb 2019 02:50:25 +0000 (+0100) Subject: defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled X-Git-Tag: v5.0~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff21492604540c96375d1d79db4b09600a60d8ac;p=strace defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled 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. --- diff --git a/defs.h b/defs.h index 53f30f26..814b481b 100644 --- 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; diff --git a/strace.c b/strace.c index ce89d5cd..b71ad05c 100644 --- 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)