Skip to content

Commit 1e9c7b2

Browse files
committed
Implement errno() on NixError
1 parent 0e369e9 commit 1e9c7b2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/nix.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ impl NixError {
2222
pub fn invalid_argument() -> NixError {
2323
NixError::Sys(EINVAL)
2424
}
25+
26+
pub fn errno(&self) -> Errno {
27+
match *self {
28+
NixError::Sys(errno) => errno,
29+
NixError::InvalidPath => Errno::EINVAL,
30+
}
31+
}
2532
}
2633

2734
pub trait NixPath {

0 commit comments

Comments
 (0)