Remove libc dependency

The function std::process::id() is available in the
"stable" channel now.
This commit is contained in:
Patrick Auernig 2018-12-04 21:29:23 +01:00
parent 6c1b159435
commit 3ebc936b10
5 changed files with 5 additions and 6 deletions

View File

@ -19,7 +19,6 @@ serde_derive = "^1.0"
serde_json = "^1.0"
byteorder = "^1.0"
log = "~0.4"
libc = "0.2.39" # until std::process::id is stable
[target.'cfg(windows)'.dependencies]
named_pipe = "0.3.0"

View File

@ -1,4 +1,5 @@
use serde::{Serialize, de::DeserializeOwned};
#[allow(unused)]
use serde_json::Value;
use connection::Manager as ConnectionManager;

View File

@ -7,7 +7,6 @@ extern crate serde;
extern crate serde_json;
extern crate byteorder;
extern crate uuid;
extern crate libc;
#[cfg(windows)]
extern crate named_pipe;

View File

@ -8,7 +8,7 @@ use utils;
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct SetActivityArgs {
pid: i32,
pid: u32,
#[serde(skip_serializing_if = "Option::is_none")]
activity: Option<Activity>,

View File

@ -1,9 +1,9 @@
use libc::getpid;
use uuid::Uuid;
pub fn pid() -> i32 {
unsafe { getpid() as i32 }
#[allow(unused)]
pub fn pid() -> u32 {
std::process::id()
}
pub fn nonce() -> String {