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:
parent
91ecfac9b6
commit
47247865eb
24
process.c
24
process.c
@ -780,7 +780,6 @@ handle_new_child(struct tcb *tcp, int pid, int bpt)
|
|||||||
{
|
{
|
||||||
struct tcb *tcpchild;
|
struct tcb *tcpchild;
|
||||||
|
|
||||||
#ifdef CLONE_PTRACE /* See new setbpt code. */
|
|
||||||
tcpchild = pid2tcb(pid);
|
tcpchild = pid2tcb(pid);
|
||||||
if (tcpchild != NULL) {
|
if (tcpchild != NULL) {
|
||||||
/* The child already reported its startup trap
|
/* 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",
|
[preattached child %d of %d in weird state!]\n",
|
||||||
pid, tcp->pid);
|
pid, tcp->pid);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
#endif /* CLONE_PTRACE */
|
|
||||||
{
|
|
||||||
tcpchild = alloctcb(pid);
|
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;
|
tcpchild->flags |= TCB_ATTACHED;
|
||||||
/* Child has BPT too, must be removed on first occasion. */
|
|
||||||
if (bpt) {
|
if (bpt) {
|
||||||
|
clearbpt(tcp);
|
||||||
|
/* Child has BPT too, must be removed on first occasion. */
|
||||||
tcpchild->flags |= TCB_BPTSET;
|
tcpchild->flags |= TCB_BPTSET;
|
||||||
tcpchild->baddr = tcp->baddr;
|
tcpchild->baddr = tcp->baddr;
|
||||||
memcpy(tcpchild->inst, tcp->inst,
|
memcpy(tcpchild->inst, tcp->inst,
|
||||||
|
Loading…
Reference in New Issue
Block a user