1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 08:33:43 -05:00

cleanup(runtime): flatten op_kill's args (#12214)

This commit is contained in:
Aaron O'Mullan 2021-09-25 01:33:15 +02:00 committed by GitHub
parent 683a38e47c
commit 4e2b59f9df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View file

@ -15,7 +15,7 @@
} = window.__bootstrap.primordials; } = window.__bootstrap.primordials;
function opKill(pid, signo) { function opKill(pid, signo) {
core.opSync("op_kill", { pid, signo }); core.opSync("op_kill", pid, signo);
} }
function opRunStatus(rid) { function opRunStatus(rid) {

View file

@ -307,17 +307,15 @@ pub fn kill(pid: i32, signal: i32) -> Result<(), AnyError> {
} }
} }
#[derive(Deserialize)] fn op_kill(
struct KillArgs { state: &mut OpState,
pid: i32, pid: i32,
signo: String, signo: String,
} ) -> Result<(), AnyError> {
fn op_kill(state: &mut OpState, args: KillArgs, _: ()) -> Result<(), AnyError> {
super::check_unstable(state, "Deno.kill"); super::check_unstable(state, "Deno.kill");
state.borrow_mut::<Permissions>().run.check_all()?; state.borrow_mut::<Permissions>().run.check_all()?;
let signo = super::signal::signal_str_to_int(&args.signo)?; let signo = super::signal::signal_str_to_int(&signo)?;
kill(args.pid, signo)?; kill(pid, signo)?;
Ok(()) Ok(())
} }