mirror of
https://github.com/Wojtek242/rwmstatus.git
synced 2024-11-21 23:25:26 +01:00
Minor rearrangement
This commit is contained in:
parent
341ba8ceec
commit
ad6720f11c
@ -30,11 +30,7 @@ pub fn get_temp(hwmon: &PathBuf) -> Result<String> {
|
|||||||
pub fn get_load_avgs() -> Result<String> {
|
pub fn get_load_avgs() -> Result<String> {
|
||||||
let mut avgs: [libc::c_double; 3] = [0.0; 3];
|
let mut avgs: [libc::c_double; 3] = [0.0; 3];
|
||||||
|
|
||||||
let rc: libc::c_int;
|
let rc = unsafe { libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3) };
|
||||||
unsafe {
|
|
||||||
rc = libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if rc < 0 {
|
if rc < 0 {
|
||||||
return Err(StatusError::System(rc));
|
return Err(StatusError::System(rc));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user