summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-06-23 22:06:39 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-06-23 22:06:39 +0200
commit47247865eb108e5f5c9cb1f0c3f40fd97cdb0978 (patch)
tree8acbae65c9738b90e1ffe6a315a6432fdd31ba99 /process.c
parent91ecfac9b61691c0ba2d878c5398c6db52c7624e (diff)
downloadstrace-47247865eb108e5f5c9cb1f0c3f40fd97cdb0978.tar.gz
strace-47247865eb108e5f5c9cb1f0c3f40fd97cdb0978.tar.bz2
strace-47247865eb108e5f5c9cb1f0c3f40fd97cdb0978.tar.xz
Remove dead "ifndef CLONE_PTRACE" branch
process.c defines CLONE_PTRACE for Linux, so it can't be undefined. Therefore ifndef CLONE_PTRACE code is dead (since at least 2004). This patch removes it. * process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not the code inside) and entire ifndef CLONE_PTRACE/endif block. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'process.c')
-rw-r--r--process.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/process.c b/process.c
index c16e93f..09200e9 100644
--- a/process.c
+++ b/process.c
@@ -780,7 +780,6 @@ handle_new_child(struct tcb *tcp, int pid, int bpt)
{
struct tcb *tcpchild;
-#ifdef CLONE_PTRACE /* See new setbpt code. */
tcpchild = pid2tcb(pid);
if (tcpchild != NULL) {
/* The child already reported its startup trap
@@ -792,30 +791,15 @@ handle_new_child(struct tcb *tcp, int pid, int bpt)
[preattached child %d of %d in weird state!]\n",
pid, tcp->pid);
}
- else
-#endif /* CLONE_PTRACE */
- {
+ else {
tcpchild = alloctcb(pid);
}
-#ifndef CLONE_PTRACE
- /* Attach to the new child */
- if (ptrace(PTRACE_ATTACH, pid, (char *) 1, 0) < 0) {
- if (bpt)
- clearbpt(tcp);
- perror("PTRACE_ATTACH");
- fprintf(stderr, "Too late?\n");
- droptcb(tcpchild);
- return 0;
- }
-#endif /* !CLONE_PTRACE */
-
- if (bpt)
- clearbpt(tcp);
-
tcpchild->flags |= TCB_ATTACHED;
- /* Child has BPT too, must be removed on first occasion. */
+
if (bpt) {
+ clearbpt(tcp);
+ /* Child has BPT too, must be removed on first occasion. */
tcpchild->flags |= TCB_BPTSET;
tcpchild->baddr = tcp->baddr;
memcpy(tcpchild->inst, tcp->inst,