From 57761032f9c70f2af779aa8c624b5fb2a80bb24f Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Mon, 8 Jan 2007 12:08:08 +0000 Subject: [PATCH] Add a timeout to work around ptrace(PTRACE_SYSCALL) on a parent attached ptrace() call never waking the child process on RHEL5 beta 2. Also did some minor code formatting cleanup. --- tests/regression/subdomain/ptrace.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/regression/subdomain/ptrace.c b/tests/regression/subdomain/ptrace.c index fef1fa3f9..7b09250cb 100644 --- a/tests/regression/subdomain/ptrace.c +++ b/tests/regression/subdomain/ptrace.c @@ -43,6 +43,13 @@ int do_parent(pid_t pid, int trace, int num_syscall) { struct user regs; int status, i; + unsigned int rc; + + rc = alarm(5); + if (rc != 0) { + fprintf(stderr, "FAIL: unexpected alarm already set\n"); + return 0; + } if (trace) { if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) == -1) { @@ -58,7 +65,7 @@ int do_parent(pid_t pid, int trace, int num_syscall) if (!WIFSTOPPED(status)) return interp_status(status); - for (i=0;i 0){ /*parent */