1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -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 Bartek Iwańczuk
parent efc8372241
commit 34ab009e3c
No known key found for this signature in database
GPG key ID: 0C6BCDDC3B3AD750
2 changed files with 22 additions and 0 deletions

View file

@ -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");
},
});

View file

@ -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),