From dc9784e0db598bcdaf303c4fa3052f527e75862c Mon Sep 17 00:00:00 2001 From: Benoit de Chezelles Date: Thu, 18 Feb 2021 00:54:38 +0100 Subject: [PATCH] Add comment --- pty/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) 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(()) }