From: Wang Chao Date: Thu, 5 Aug 2010 06:30:11 +0000 (+0800) Subject: Forbid using mutually exclusive options -D and -p together X-Git-Tag: v4.6~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d322a4bbe118642c4c9b170451a601a1e80b72d6;p=strace Forbid using mutually exclusive options -D and -p together If we use -D and -p option together to trace a multi-thread program, in addition to the main thread, other threads could not be traced even if we present -f option. Moreover, when executing 'strace -D -p ', strace could not terminate normally. * strace.c (main): Check it. Signed-off-by: Wang Chao --- diff --git a/strace.c b/strace.c index 21febb35..35059483 100644 --- a/strace.c +++ b/strace.c @@ -846,6 +846,13 @@ main(int argc, char *argv[]) if ((optind == argc) == !pflag_seen) usage(stderr, 1); + if (pflag_seen && daemonized_tracer) { + fprintf(stderr, + "%s: -D and -p are mutually exclusive options\n", + progname); + exit(1); + } + if (!followfork) followfork = optF;