Skip to content

Commit

Permalink
Implement errno() on NixError
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Mar 18, 2015
1 parent 0e369e9 commit 1e9c7b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/nix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ impl NixError {
pub fn invalid_argument() -> NixError {
NixError::Sys(EINVAL)
}

pub fn errno(&self) -> Errno {
match *self {
NixError::Sys(errno) => errno,
NixError::InvalidPath => Errno::EINVAL,
}
}
}

pub trait NixPath {
Expand Down

0 comments on commit 1e9c7b2

Please sign in to comment.