Skip to content
Browse files

Better status reporting during attach.

  • Loading branch information...
1 parent 18ebcd0 commit 189df96f40c40f4de8424d2a50ad387a17b317f6 @nelhage committed Jan 21, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 attach.c
View
8 attach.c
@@ -88,7 +88,7 @@ void move_process_group(struct ptrace_child *from, pid_t to) {
pid, to,
0, 0, 0, 0);
if (err < 0)
- debug(" failed: %s", strerror(-err));
+ error(" failed: %s", strerror(-err));
}
}
closedir(dir);
@@ -183,7 +183,7 @@ int attach_child(pid_t pid, const char *pty) {
err = ptrace_remote_syscall(&dummy, __NR_setpgid,
0, 0, 0, 0, 0, 0);
if (err < 0) {
- debug("Failed to setpgid: %s", strerror(-err));
+ error("Failed to setpgid: %s", strerror(-err));
goto out_kill;
}
@@ -192,7 +192,7 @@ int attach_child(pid_t pid, const char *pty) {
err = ptrace_remote_syscall(&child, __NR_setsid,
0, 0, 0, 0, 0, 0);
if (err < 0) {
- debug("Failed to setsid: %s", strerror(-err));
+ error("Failed to setsid: %s", strerror(-err));
goto out_kill;
}
@@ -258,5 +258,5 @@ int attach_child(pid_t pid, const char *pty) {
if (err == 0)
kill(child.pid, SIGWINCH);
- return err;
+ return err < 0 ? -err : err;
}

0 comments on commit 189df96

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