Add comment

This commit is contained in:
Benoit de Chezelles authored and Wez Furlong committed 2021-02-18 09:50:50 -08:00
1 parent 18e8d48171
commit dc9784e0db
1 file changed
+5
+5
View File
@@ -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(())
}