diff --git a/pty/src/lib.rs b/pty/src/lib.rs index 079d83c85..9097b0f3a 100644 --- a/pty/src/lib.rs +++ b/pty/src/lib.rs @@ -190,6 +190,11 @@ impl Child for std::process::Child { fn kill(&mut self) -> IoResult<()> { #[cfg(unix)] { + // On unix, we send the SIGHUP signal instead of trying to kill + // the process. The default behavior of a process receiving this + // signal is to be killed unless it configured a signal handler. + // In this case the process is responsible of itself, releasing + // resources and terminating itself, or become a daemon. unsafe { libc::kill(self.id() as i32, libc::SIGHUP) }; Ok(()) }