summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {