Skip to content
Browse files

ptrace.c: Don't spin forever if the child gets a weird signal.

  • Loading branch information...
1 parent 1e854b1 commit 95e1d51d98153f5048e4bd67f32e1243a3d000b6 @nelhage committed Jan 17, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 ptrace.c
View
2 ptrace.c
@@ -74,6 +74,8 @@ int ptrace_wait(struct ptrace_child *child) {
ptrace(PTRACE_GETEVENTMSG, child->pid, 0, &child->forked_pid);
if (child->state != ptrace_at_syscall)
child->state = ptrace_stopped;
+ if (sig != SIGSTOP && sig != SIGTRAP && sig != SIGCHLD)
+ return -1;
}
} else {
errno = EINVAL;

0 comments on commit 95e1d51

Please sign in to comment.
Something went wrong with that request. Please try again.