1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 16:19:12 -05:00

fix(runtime): add missing SIGIOT alias to SIGABRT (#19333)

This commit is contained in:
Marvin Hagemeister 2023-06-01 00:39:01 +02:00 committed by GitHub
parent f3193e0e1c
commit 926d493f19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -599,3 +599,22 @@ Deno.test(
assertStringIncludes(output, "close"); 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");
},
});

View file

@ -113,6 +113,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> {
"SIGQUIT" => Ok(3), "SIGQUIT" => Ok(3),
"SIGILL" => Ok(4), "SIGILL" => Ok(4),
"SIGTRAP" => Ok(5), "SIGTRAP" => Ok(5),
"SIGIOT" => Ok(6),
"SIGABRT" => Ok(6), "SIGABRT" => Ok(6),
"SIGEMT" => Ok(7), "SIGEMT" => Ok(7),
"SIGFPE" => Ok(8), "SIGFPE" => Ok(8),
@ -193,6 +194,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> {
"SIGQUIT" => Ok(3), "SIGQUIT" => Ok(3),
"SIGILL" => Ok(4), "SIGILL" => Ok(4),
"SIGTRAP" => Ok(5), "SIGTRAP" => Ok(5),
"SIGIOT" => Ok(6),
"SIGABRT" => Ok(6), "SIGABRT" => Ok(6),
"SIGBUS" => Ok(7), "SIGBUS" => Ok(7),
"SIGFPE" => Ok(8), "SIGFPE" => Ok(8),
@ -269,6 +271,7 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> {
"SIGQUIT" => Ok(3), "SIGQUIT" => Ok(3),
"SIGILL" => Ok(4), "SIGILL" => Ok(4),
"SIGTRAP" => Ok(5), "SIGTRAP" => Ok(5),
"SIGIOT" => Ok(6),
"SIGABRT" => Ok(6), "SIGABRT" => Ok(6),
"SIGEMT" => Ok(7), "SIGEMT" => Ok(7),
"SIGFPE" => Ok(8), "SIGFPE" => Ok(8),