From b6fc81066cfcc29d4519191eae5ba19581ad2774 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 24 Feb 2024 21:24:19 -0700 Subject: Replace ctrlc with signal-hook Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT. The 'signal_hook::low_level::register' function is actually unsafe. However, according to https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html, it is only unsafe in the case of multithreaded applications. There are some race conditions as well. For instance, it appears that even when we fork to a child process, SIGINT is captured on both that process, as well as the shell. --- Cargo.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 00fdb24..ae18cfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,5 @@ description = "A POSIX compliance shell and tiny functional programming language name = "dwvsh" path = "src/main.rs" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -ctrlc = "3.4.2" +signal-hook = "0.3.17" -- cgit v1.2.3