summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2015-03-18 15:53:29 -0700
committerCarl Lerche <me@carllerche.com>2015-03-18 15:53:29 -0700
commit1e9c7b2a4ae48584b1c19bf7077dd0a237ad47c3 (patch)
tree44ebb6e10ec085d19be8ee6fe2b12ec74ca67db2
parent0e369e931f5927a31bec4e5ca6ee21ebb60e6e7f (diff)
downloadnix-1e9c7b2a4ae48584b1c19bf7077dd0a237ad47c3.zip
Implement errno() on NixError
-rw-r--r--src/nix.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nix.rs b/src/nix.rs
index eafbbf4d..f5195c40 100644
--- a/src/nix.rs
+++ b/src/nix.rs
@@ -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 {