From c132c8690bc92fa306b2082992f3b7108e5a4c9e Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 6 Sep 2021 10:05:33 -0400 Subject: BREAKING(unstable): Remove Deno.Signals enum, Deno.signals.* (#11909) --- runtime/ops/process.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/ops/process.rs') 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>, rid: ResourceId, _: (), -) -> Result { +) -> Result { 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::().run.check_all()?; - kill(args.pid, args.signo)?; + let signo = super::signal::signal_str_to_int_unwrap(&args.signo)?; + kill(args.pid, signo)?; Ok(()) } -- cgit v1.2.3