Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ jobs:
with:
toolchain: ${{ matrix.toolchain }}

- name: Format
# format always on stable, to avoid different toolchains pingponging
run: cargo +stable fmt --all --check

- name: Build
run: cargo +${{ matrix.toolchain }} build --workspace --verbose

- name: Run tests
run: cargo +${{ matrix.toolchain }} test --workspace --all-features --verbose -- --skip _runsinglethread

- name: Run tests (single-threaded tests)
run: cargo +${{ matrix.toolchain }} test --workspace --all-features --verbose -- _runsinglethread --test-threads 1

Expand All @@ -52,6 +58,7 @@ jobs:
with:
toolchain: ${{ matrix.toolchain }}
target: aarch64-linux-android

- name: Install toolchains (i686)
uses: actions-rs/toolchain@v1
with:
Expand All @@ -60,6 +67,7 @@ jobs:

- name: cargo check (aarch64)
run: cargo +${{ matrix.toolchain }} check --workspace --target aarch64-linux-android --all-features

- name: cargo check (i686)
run: cargo +${{ matrix.toolchain }} check --workspace --target i686-unknown-linux-gnu --all-features

2 changes: 1 addition & 1 deletion procfs-core/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl crate::FromBufRead for MemoryMaps {
match reader.read_line(&mut line) {
// End of file.
Ok(0) => break,
Ok(_) => {},
Ok(_) => {}
Err(_) => return Err(ProcError::Incomplete(None)),
}

Expand Down
5 changes: 4 additions & 1 deletion procfs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ fn main() {
// Filters are extracted from `libc` filters
let target_os = std::env::var("CARGO_CFG_TARGET_OS").expect("Missing CARGO_CFG_TARGET_OS envvar");
if !["android", "linux", "l4re"].contains(&target_os.as_str()) {
eprintln!("Building {} on an for a unsupported platform. Currently only linux and android are supported", env!("CARGO_PKG_NAME"));
eprintln!(
"Building {} on an for a unsupported platform. Currently only linux and android are supported",
env!("CARGO_PKG_NAME")
);
eprintln!("(Your current target_os is {})", target_os);
std::process::exit(1)
}
Expand Down
5 changes: 4 additions & 1 deletion procfs/examples/lslocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use std::path::Path;
fn main() {
let myself = Process::myself().unwrap();
let mountinfo = myself.mountinfo().unwrap();
println!("{:18}{:13}{:13}{:13}{:12} Path", "Process", "PID", "Lock Type", "Mode", "Kind");
println!(
"{:18}{:13}{:13}{:13}{:12} Path",
"Process", "PID", "Lock Type", "Mode", "Kind"
);
println!("{}", "=".repeat(74));
for lock in procfs::locks().unwrap() {
lock.pid
Expand Down
4 changes: 2 additions & 2 deletions procfs/examples/mounts.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// List mountpoints listed in /proc/mounts

fn main() {
let width = 15;
let width = 15;
for mount_entry in procfs::mounts().unwrap() {
println!("Device: {}", mount_entry.fs_spec);
println!("{:>width$}: {}", "Mount point", mount_entry.fs_file);
println!("{:>width$}: {}","FS type", mount_entry.fs_vfstype);
println!("{:>width$}: {}", "FS type", mount_entry.fs_vfstype);
println!("{:>width$}: {}", "Dump", mount_entry.fs_freq);
println!("{:>width$}: {}", "Check", mount_entry.fs_passno);
print!("{:>width$}: ", "Options");
Expand Down
6 changes: 2 additions & 4 deletions procfs/src/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

use procfs_core::ProcResult;
pub use procfs_core::CryptoTable;
use procfs_core::ProcResult;

use crate::Current;

Expand All @@ -12,7 +11,6 @@ pub fn crypto() -> ProcResult<CryptoTable> {
CryptoTable::current()
}


#[cfg(test)]
mod tests {
use super::*;
Expand All @@ -23,4 +21,4 @@ mod tests {
let table = table.expect("CrytoTable should have been read");
assert!(!table.crypto_blocks.is_empty(), "Crypto table was empty");
}
}
}
2 changes: 1 addition & 1 deletion procfs/src/sys/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Version {
Self {
major,
minor,
patch: u16::from_ne_bytes([lo, hi])
patch: u16::from_ne_bytes([lo, hi]),
}
}

Expand Down
2 changes: 1 addition & 1 deletion procfs/src/sys/kernel/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::{read_value, write_value, ProcError, ProcResult};
use std::path::Path;

const RANDOM_ROOT: &str = "/proc/sys/kernel/random";
const RANDOM_ROOT: &str = "/proc/sys/kernel/random";

/// This read-only file gives the available entropy, in bits. This will be a number in the range
/// 0 to 4096
Expand Down
Loading