Skip to content

Commit

Permalink
fix: try to use ctrl c event to exit clash
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Jul 27, 2024
1 parent a4d5545 commit 50b9744
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions os-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pub trait ChildExt {

#[cfg(windows)]
fn gracefully_kill(pid: u32) -> std::io::Result<()> {
use windows::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_BREAK_EVENT};
use windows::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_C_EVENT};
unsafe {
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, pid).map_err(|e| {
GenerateConsoleCtrlEvent(CTRL_C_EVENT, pid).map_err(|e| {
std::io::Error::new(
std::io::ErrorKind::Other,
format!("GenerateConsoleCtrlEvent failed: {:?}", e),
Expand Down

0 comments on commit 50b9744

Please sign in to comment.