fix: server-side Ctrl-C handling for Windows x86_64 targets (attempt 2)
The current implementation of Ctrl-C handling was not properly tested on Windows x86_64 architectures. To address this, the code has been modified to use `i32` instead of `BOOL` to handle the result of the `GenerateConsoleCtrlEvent` function, ensuring that the return value is correctly checked across different platforms.
This commit is contained in:
parent
6ab7d37a08
commit
11db1ecaed
@ -201,12 +201,11 @@ pub async fn unload_llama_model(
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
{
|
||||
use windows_sys::Win32::Foundation::BOOL;
|
||||
use windows_sys::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_C_EVENT};
|
||||
|
||||
if let Some(raw_pid) = child.id() {
|
||||
log::info!("Sending Ctrl-C to PID {}", raw_pid);
|
||||
let ok: BOOL = unsafe {
|
||||
let ok: i32 = unsafe {
|
||||
GenerateConsoleCtrlEvent(CTRL_C_EVENT, raw_pid as u32)
|
||||
};
|
||||
if ok == 0 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user