From 21ccf5ed07ed7b9f208827dc7ba9b932bfa6cfaa Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 13 Jan 2011 14:49:39 +0000 Subject: [PATCH] Test PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK along with PTRACE_O_TRACEFORK * strace.c (test_ptrace_setoptions): Add PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK to PTRACE_SETOPTIONS call, to test exactly the same set of options that is going to be used later in trace(). --- strace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/strace.c b/strace.c index e1ae8f17..6b0ebacf 100644 --- a/strace.c +++ b/strace.c @@ -726,13 +726,14 @@ test_ptrace_setoptions(void) kill(tracee_pid, SIGKILL); } else if (WIFSTOPPED(status)) { + const unsigned int test_options = PTRACE_O_TRACECLONE | + PTRACE_O_TRACEFORK | + PTRACE_O_TRACEVFORK; if (status >> 16 == PTRACE_EVENT_FORK) - ptrace_setoptions |= (PTRACE_O_TRACEVFORK | - PTRACE_O_TRACECLONE | - PTRACE_O_TRACEFORK); + ptrace_setoptions |= test_options; if (WSTOPSIG(status) == SIGSTOP) { if (ptrace(PTRACE_SETOPTIONS, pid, NULL, - PTRACE_O_TRACEFORK) < 0) { + test_options) < 0) { kill(pid, SIGKILL); return -1; } -- 2.50.1