diff options
author | Marvin Hagemeister <hello@marvinh.dev> | 2023-06-01 00:39:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 16:39:01 -0600 |
commit | 926d493f1967faa143205ad02a9c35f757829603 (patch) | |
tree | e3c791f50f923142e5869c603c670ee6e46e03a2 | |
parent | f3193e0e1c12ea139f00d6b19d152b95f37b73c3 (diff) |
fix(runtime): add missing SIGIOT alias to SIGABRT (#19333)
-rw-r--r-- | cli/tests/unit_node/child_process_test.ts | 19 | ||||
-rw-r--r-- | runtime/ops/signal.rs | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts index e89fd7d79..d4a2a4cc6 100644 --- a/cli/tests/unit_node/child_process_test.ts +++ b/cli/tests/unit_node/child_process_test.ts @@ -599,3 +599,22 @@ Deno.test( assertStringIncludes(output, "close"); }, ); + +Deno.test({ + name: "[node/child_process spawn] supports SIGIOT signal", + ignore: Deno.build.os === "windows", + async fn() { + const script = path.join( + path.dirname(path.fromFileUrl(import.meta.url)), + "testdata", + "child_process_stdin.js", + ); + const cp = spawn(Deno.execPath(), ["run", "-A", script]); + const p = withTimeout(); + cp.on("exit", () => p.resolve()); + cp.kill("SIGIOT"); + await p; + assert(cp.killed); + assertEquals(cp.signalCode, "SIGIOT"); + }, +}); diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 93e1cfef2..ba9a2a178 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -113,6 +113,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGEMT" => Ok(7), "SIGFPE" => Ok(8), @@ -193,6 +194,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGBUS" => Ok(7), "SIGFPE" => Ok(8), @@ -269,6 +271,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGEMT" => Ok(7), "SIGFPE" => Ok(8), |