Skip to content

Commit

Permalink
Better status reporting during attach.
Browse files Browse the repository at this point in the history
  • Loading branch information
nelhage committed Jan 22, 2011
1 parent 18ebcd0 commit 189df96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions attach.c
Expand Up @@ -88,7 +88,7 @@ void move_process_group(struct ptrace_child *from, pid_t to) {
pid, to, pid, to,
0, 0, 0, 0); 0, 0, 0, 0);
if (err < 0) if (err < 0)
debug(" failed: %s", strerror(-err)); error(" failed: %s", strerror(-err));
} }
} }
closedir(dir); closedir(dir);
Expand Down Expand Up @@ -183,7 +183,7 @@ int attach_child(pid_t pid, const char *pty) {
err = ptrace_remote_syscall(&dummy, __NR_setpgid, err = ptrace_remote_syscall(&dummy, __NR_setpgid,
0, 0, 0, 0, 0, 0); 0, 0, 0, 0, 0, 0);
if (err < 0) { if (err < 0) {
debug("Failed to setpgid: %s", strerror(-err)); error("Failed to setpgid: %s", strerror(-err));
goto out_kill; goto out_kill;
} }


Expand All @@ -192,7 +192,7 @@ int attach_child(pid_t pid, const char *pty) {
err = ptrace_remote_syscall(&child, __NR_setsid, err = ptrace_remote_syscall(&child, __NR_setsid,
0, 0, 0, 0, 0, 0); 0, 0, 0, 0, 0, 0);
if (err < 0) { if (err < 0) {
debug("Failed to setsid: %s", strerror(-err)); error("Failed to setsid: %s", strerror(-err));
goto out_kill; goto out_kill;
} }


Expand Down Expand Up @@ -258,5 +258,5 @@ int attach_child(pid_t pid, const char *pty) {
if (err == 0) if (err == 0)
kill(child.pid, SIGWINCH); kill(child.pid, SIGWINCH);


return err; return err < 0 ? -err : err;
} }

0 comments on commit 189df96

Please sign in to comment.