Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98057
b: refs/heads/master
c: f1ef916
h: refs/heads/master
i:
  98055: 2c71bdc
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Jun 13, 2008
1 parent bbf93e9 commit da3bc09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14c8a77e1bbd693446dad297d2ae2dd22f187e4f
refs/heads/master: f1ef9167ca4494a8c6d71d0031c73e9c8841eadd
25 changes: 16 additions & 9 deletions trunk/arch/um/os-Linux/start_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit)
{
int status, n, ret = 0;

if (ptrace(PTRACE_CONT, pid, 0, 0) < 0)
fatal_perror("stop_ptraced_child : ptrace failed");
if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) {
perror("stop_ptraced_child : ptrace failed");
return -1;
}
CATCH_EINTR(n = waitpid(pid, &status, 0));
if (!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
int exit_with = WEXITSTATUS(status);
Expand Down Expand Up @@ -212,7 +214,7 @@ static void __init check_sysemu(void)
if (n < 0)
fatal_perror("check_sysemu : wait failed");
if (!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP))
fatal("check_sysemu : expected SIGTRAP, got status = %d",
fatal("check_sysemu : expected SIGTRAP, got status = %d\n",
status);

if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
Expand Down Expand Up @@ -254,9 +256,11 @@ static void __init check_sysemu(void)

if (WIFSTOPPED(status) &&
(WSTOPSIG(status) == (SIGTRAP|0x80))) {
if (!count)
fatal("check_ptrace : SYSEMU_SINGLESTEP "
"doesn't singlestep");
if (!count) {
non_fatal("check_ptrace : SYSEMU_SINGLESTEP "
"doesn't singlestep");
goto fail;
}
n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,
os_getpid());
if (n < 0)
Expand All @@ -266,9 +270,12 @@ static void __init check_sysemu(void)
}
else if (WIFSTOPPED(status) && (WSTOPSIG(status) == SIGTRAP))
count++;
else
fatal("check_ptrace : expected SIGTRAP or "
"(SIGTRAP | 0x80), got status = %d", status);
else {
non_fatal("check_ptrace : expected SIGTRAP or "
"(SIGTRAP | 0x80), got status = %d\n",
status);
goto fail;
}
}
if (stop_ptraced_child(pid, 0, 0) < 0)
goto fail_stopped;
Expand Down

0 comments on commit da3bc09

Please sign in to comment.