From 189df96f40c40f4de8424d2a50ad387a17b317f6 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Fri, 21 Jan 2011 19:35:33 -0500 Subject: [PATCH] Better status reporting during attach. --- attach.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/attach.c b/attach.c index 2e6574c..15693f8 100644 --- a/attach.c +++ b/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; }