diff options
author | Carl Lerche <me@carllerche.com> | 2015-02-23 22:58:18 -0800 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-02-23 22:58:18 -0800 |
commit | fcc952a18c054821480964bc1b0f7b32e7728e62 (patch) | |
tree | b922a4d92c6a7e23fe5181d911a6f7200755b4e2 /src/nix.rs | |
parent | 979faf097691dc35bb12b91dcde0d804a3d32b79 (diff) | |
download | nix-fcc952a18c054821480964bc1b0f7b32e7728e62.zip |
in_addr conversions + IP_DROP_MEMBERSHIP support
Diffstat (limited to 'src/nix.rs')
-rw-r--r-- | src/nix.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,7 +1,7 @@ use libc; use std; -use errno::Errno; +use errno::{Errno, EINVAL}; pub type NixResult<T> = Result<T, NixError>; @@ -11,6 +11,12 @@ pub enum NixError { InvalidPath } +impl NixError { + pub fn invalid_argument() -> NixError { + NixError::Sys(EINVAL) + } +} + pub trait NixPath { fn with_nix_path<T, F>(&self, f: F) -> Result<T, NixError> where F: FnOnce(*const libc::c_char) -> T; |