mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Merge pull request #653 from kxxt/kill-child-safely
Use safe kill from nix crate
This commit is contained in:
@@ -4,7 +4,7 @@ use anyhow::{bail, Result};
|
||||
use nix::errno::Errno;
|
||||
use nix::libc::EIO;
|
||||
use nix::sys::select::{select, FdSet};
|
||||
use nix::sys::signal;
|
||||
use nix::sys::signal::{self, kill, Signal};
|
||||
use nix::sys::wait::{self, WaitPidFlag, WaitStatus};
|
||||
use nix::unistd::{self, ForkResult};
|
||||
use nix::{libc, pty};
|
||||
@@ -265,7 +265,8 @@ fn copy<T: Tty + ?Sized, H: Handler>(
|
||||
}
|
||||
|
||||
if kill_the_child {
|
||||
unsafe { libc::kill(child.as_raw(), SIGTERM) };
|
||||
// Any errors occurred when killing the child are ignored.
|
||||
let _ = kill(child, Signal::SIGTERM);
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user