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