Update ps.rs

This commit is contained in:
Jonathan Turner 2019-08-21 20:19:36 +12:00 committed by GitHub
parent 9c61d6d590
commit 23ef76a86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,12 +28,12 @@ impl WholeStreamCommand for PS {
fn ps(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> { fn ps(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
let system; let system;
#[cfg(linux)] #[cfg(target_os = "linux")]
{ {
system = sysinfo::System::new(); system = sysinfo::System::new();
} }
#[cfg(not(linux))] #[cfg(not(target_os = "linux"))]
{ {
let mut sy = sysinfo::System::new_with_specifics(RefreshKind::new().with_processes()); let mut sy = sysinfo::System::new_with_specifics(RefreshKind::new().with_processes());
sy.refresh_processes(); sy.refresh_processes();