diff --git a/Cargo.lock b/Cargo.lock index 90cd1fe..ace69d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1269,7 +1269,6 @@ dependencies = [ "insta", "log", "mockito", - "nix", "openpnp_capture", "rand", "rerobots", @@ -1746,15 +1745,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.17" @@ -1808,19 +1798,6 @@ dependencies = [ "serde_urlencoded", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset", - "pin-utils", -] - [[package]] name = "nom" version = "7.1.3" diff --git a/Cargo.toml b/Cargo.toml index 6128e0b..8fc63c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ futures = "0.3" home = "0.5.3" image = "0.24.6" log = "0.4" -nix = "0.26" rand = "0.8.5" rerobots = "0.12" serde = { version = "1.0", features = ["derive"] } diff --git a/src/api.rs b/src/api.rs index c32b7a0..7632d64 100644 --- a/src/api.rs +++ b/src/api.rs @@ -13,6 +13,7 @@ // limitations under the License. use std::collections::HashMap; +use std::process; use std::sync::{mpsc, Arc, Mutex}; use std::time::Duration; @@ -28,8 +29,6 @@ use awc::{ use futures::stream::{SplitSink, StreamExt}; -use nix::{sys::signal, unistd}; - extern crate serde; extern crate serde_json; use serde::{Deserialize, Serialize}; @@ -1166,7 +1165,7 @@ impl HSAPIClient { std::fs::create_dir(&path)? } let path = path.join(format!("{}.pid", hscamera_id)); - let pid = unistd::getpid(); + let pid = process::id(); std::fs::write(&path, pid.to_string())?; debug!("starting camera stream...");