diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-09-25 01:33:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-25 01:33:15 +0200 |
commit | 4e2b59f9df5085025f08faea24e76b009e47f68d (patch) | |
tree | 61ff790ebfa172bb1635728e37636540859a1db1 /runtime | |
parent | 683a38e47c47609d28bc6964f4b082885e477bf3 (diff) |
cleanup(runtime): flatten op_kill's args (#12214)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/js/40_process.js | 2 | ||||
-rw-r--r-- | runtime/ops/process.rs | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js index 782dfe476..26d452a4d 100644 --- a/runtime/js/40_process.js +++ b/runtime/js/40_process.js @@ -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) { diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 581bd4bb2..1f7280d48 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -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(()) } |