diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-09-06 10:05:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-06 10:05:33 -0400 |
commit | c132c8690bc92fa306b2082992f3b7108e5a4c9e (patch) | |
tree | df152f94815b8ace8fd99696d003eb8adef06d53 /runtime/ops/process.rs | |
parent | b7c2902c9752e83dc467ce6a812dab4726f200d9 (diff) |
BREAKING(unstable): Remove Deno.Signals enum, Deno.signals.* (#11909)
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r-- | runtime/ops/process.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 44ead73da..b1d5e80ca 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -198,7 +198,7 @@ fn op_run( #[derive(Serialize)] #[serde(rename_all = "camelCase")] -struct RunStatus { +struct ProcessStatus { got_signal: bool, exit_code: i32, exit_signal: i32, @@ -208,7 +208,7 @@ async fn op_run_status( state: Rc<RefCell<OpState>>, rid: ResourceId, _: (), -) -> Result<RunStatus, AnyError> { +) -> Result<ProcessStatus, AnyError> { let resource = state .borrow_mut() .resource_table @@ -227,7 +227,7 @@ async fn op_run_status( .expect("Should have either an exit code or a signal."); let got_signal = signal.is_some(); - Ok(RunStatus { + Ok(ProcessStatus { got_signal, exit_code: code.unwrap_or(-1), exit_signal: signal.unwrap_or(-1), @@ -288,13 +288,14 @@ pub fn kill(pid: i32, signal: i32) -> Result<(), AnyError> { #[derive(Deserialize)] struct KillArgs { pid: i32, - signo: i32, + signo: String, } fn op_kill(state: &mut OpState, args: KillArgs, _: ()) -> Result<(), AnyError> { super::check_unstable(state, "Deno.kill"); state.borrow_mut::<Permissions>().run.check_all()?; - kill(args.pid, args.signo)?; + let signo = super::signal::signal_str_to_int_unwrap(&args.signo)?; + kill(args.pid, signo)?; Ok(()) } |