Use libc::getpid instead of std::process::id
Until the std::process::id interface becomes stable.
This commit is contained in:
parent
6d83bc0af2
commit
0e38bf634d
|
@ -1,8 +1,8 @@
|
|||
language: rust
|
||||
cache: cargo
|
||||
rust:
|
||||
- stable
|
||||
- nightly
|
||||
# - stable # would fail, std::process::id is unstable
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
|
|
|
@ -19,6 +19,7 @@ serde_derive = "^1.0"
|
|||
serde_json = "^1.0"
|
||||
byte = "0.2"
|
||||
log = "~0.4"
|
||||
libc = "0.2.39" # until std::process::id is stable
|
||||
|
||||
[dependencies.uuid]
|
||||
version = "^0.6.2"
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![feature(getpid)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
|
@ -8,6 +6,7 @@ extern crate serde;
|
|||
extern crate serde_json;
|
||||
extern crate byte;
|
||||
extern crate uuid;
|
||||
extern crate libc;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::process::id as pid;
|
||||
use libc::getpid;
|
||||
use models::Command;
|
||||
|
||||
#[derive(Debug, Default, Serialize)]
|
||||
|
@ -10,7 +10,7 @@ pub struct SetActivityArgs {
|
|||
impl SetActivityArgs {
|
||||
pub fn command(args: SetActivity) -> Command<Self> {
|
||||
Command::new("SET_ACTIVITY", Self {
|
||||
pid: pid(),
|
||||
pid: unsafe { getpid() as u32 },
|
||||
activity: args
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue