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>
This commit is contained in:
Denys Vlasenko 2011-06-23 22:06:39 +02:00
parent 91ecfac9b6
commit 47247865eb

View File

@ -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,