Permalink
Browse files

Send the child an explicit SIGCONT once we're done.

This causes bash to notice that the process is backgrounded, which prevents it
from sending a SIGTERM when the original shell exits.
  • Loading branch information...
1 parent f190aa9 commit c1019cf1807de0b17af4ae2607a376e01dcbbced @nelhage committed Jan 25, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 attach.c
View
@@ -355,8 +355,10 @@ int attach_child(pid_t pid, const char *pty) {
out_detach:
ptrace_detach_child(&child);
- if (err == 0)
+ if (err == 0) {
+ kill(child.pid, SIGCONT);
kill(child.pid, SIGWINCH);
+ }
return err < 0 ? -err : err;
}

0 comments on commit c1019cf

Please sign in to comment.