Skip to content

Commit

Permalink
Use Result alias for utsname
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Mar 16, 2022
1 parent 159d9b5 commit bc75389
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/utsname.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Get system identification
use std::mem;
use libc::c_char;
use crate::Errno;
use crate::{Errno, Result};

/// Describes the running system. Return type of [`uname`].
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
Expand Down Expand Up @@ -36,7 +36,7 @@ impl UtsName {
}

/// Get system identification
pub fn uname() -> Result<UtsName, Errno> {
pub fn uname() -> Result<UtsName> {
unsafe {
let mut ret = mem::MaybeUninit::zeroed();
Errno::result(libc::uname(ret.as_mut_ptr()))?;
Expand Down

0 comments on commit bc75389

Please sign in to comment.