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:
parent
683a38e47c
commit
4e2b59f9df
2 changed files with 6 additions and 8 deletions
|
@ -15,7 +15,7 @@
|
|||
} = window.__bootstrap.primordials;
|
||||
|
||||
function opKill(pid, signo) {
|
||||
core.opSync("op_kill", { pid, signo });
|
||||
core.opSync("op_kill", pid, signo);
|
||||
}
|
||||
|
||||
function opRunStatus(rid) {
|
||||
|
|
|
@ -307,17 +307,15 @@ pub fn kill(pid: i32, signal: i32) -> Result<(), AnyError> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct KillArgs {
|
||||
fn op_kill(
|
||||
state: &mut OpState,
|
||||
pid: i32,
|
||||
signo: String,
|
||||
}
|
||||
|
||||
fn op_kill(state: &mut OpState, args: KillArgs, _: ()) -> Result<(), AnyError> {
|
||||
) -> Result<(), AnyError> {
|
||||
super::check_unstable(state, "Deno.kill");
|
||||
state.borrow_mut::<Permissions>().run.check_all()?;
|
||||
|
||||
let signo = super::signal::signal_str_to_int(&args.signo)?;
|
||||
kill(args.pid, signo)?;
|
||||
let signo = super::signal::signal_str_to_int(&signo)?;
|
||||
kill(pid, signo)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue