Skip to content

Commit

Permalink
Qemu ctrl c exit (#2147)
Browse files Browse the repository at this point in the history
* fix

* ignore

* fix

* aaa

* bbb
  • Loading branch information
tokatoka authored May 6, 2024
1 parent b0d592d commit 4562f19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libafl/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Handler for ShutdownSignalData {
// println!("Exiting from the handler....");

#[cfg(unix)]
libc::_exit(100);
libc::_exit(CTRL_C_EXIT);

#[cfg(windows)]
windows::Win32::System::Threading::ExitProcess(100);
Expand Down
4 changes: 2 additions & 2 deletions libafl_qemu/src/emu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
ptr,
};

use libafl::executors::ExitKind;
use libafl::{events::CTRL_C_EXIT, executors::ExitKind};
#[cfg(emulation_mode = "systemmode")]
use libafl_qemu_sys::qemu_init;
#[cfg(emulation_mode = "usermode")]
Expand Down Expand Up @@ -287,7 +287,7 @@ where
let (command, ret_reg): (Option<Command>, Option<Regs>) = match &mut exit_reason {
EmuExitReason::End(shutdown_cause) => match shutdown_cause {
QemuShutdownCause::HostSignal(Signal::SigInterrupt) => {
return Ok(InnerHandlerResult::Interrupt)
std::process::exit(CTRL_C_EXIT);
}
QemuShutdownCause::GuestPanic => {
return Ok(InnerHandlerResult::EndOfRun(ExitKind::Crash))
Expand Down

0 comments on commit 4562f19

Please sign in to comment.