diff options
Diffstat (limited to 'cli/ops/process.rs')
-rw-r--r-- | cli/ops/process.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cli/ops/process.rs b/cli/ops/process.rs index 3a7db8249..5099889cd 100644 --- a/cli/ops/process.rs +++ b/cli/ops/process.rs @@ -1,6 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::io::{std_file_resource, StreamResource, StreamResourceHolder}; +use crate::permissions::Permissions; use crate::signal::kill; use deno_core::error::bad_resource_id; use deno_core::error::type_error; @@ -68,7 +69,7 @@ fn op_run( _zero_copy: &mut [ZeroCopyBuf], ) -> Result<Value, AnyError> { let run_args: RunArgs = serde_json::from_value(args)?; - super::cli_state(state).check_run()?; + state.borrow::<Permissions>().check_run()?; let args = run_args.cmd; let env = run_args.env; @@ -178,7 +179,10 @@ async fn op_run_status( let args: RunStatusArgs = serde_json::from_value(args)?; let rid = args.rid as u32; - super::cli_state2(&state).check_run()?; + { + let s = state.borrow(); + s.borrow::<Permissions>().check_run()?; + } let run_status = poll_fn(|cx| { let mut state = state.borrow_mut(); @@ -221,9 +225,9 @@ fn op_kill( args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<Value, AnyError> { - let cli_state = super::cli_state(state); + let cli_state = super::global_state(state); cli_state.check_unstable("Deno.kill"); - cli_state.check_run()?; + state.borrow::<Permissions>().check_run()?; let args: KillArgs = serde_json::from_value(args)?; kill(args.pid, args.signo)?; |