From 1e9c7b2a4ae48584b1c19bf7077dd0a237ad47c3 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 18 Mar 2015 15:53:29 -0700 Subject: Implement errno() on NixError --- src/nix.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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 { -- cgit v1.2.3