diff options
author | Carl Lerche <me@carllerche.com> | 2015-03-18 15:53:29 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-03-18 15:53:29 -0700 |
commit | 1e9c7b2a4ae48584b1c19bf7077dd0a237ad47c3 (patch) | |
tree | 44ebb6e10ec085d19be8ee6fe2b12ec74ca67db2 /src | |
parent | 0e369e931f5927a31bec4e5ca6ee21ebb60e6e7f (diff) | |
download | nix-1e9c7b2a4ae48584b1c19bf7077dd0a237ad47c3.zip |
Implement errno() on NixError
Diffstat (limited to 'src')
-rw-r--r-- | src/nix.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 { |