summaryrefslogtreecommitdiff
path: root/runtime/ops/process.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r--runtime/ops/process.rs11
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(())
}