diff --git a/Cargo.toml b/Cargo.toml index 13bc66c..3e0212f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ libiio_v0_19 = ["libiio-sys/libiio_v0_19"] [dependencies] libiio-sys = { version = "0.4.0-pre.0", path = "libiio-sys", default-features = false } thiserror = "1.0" -nix = "0.26" +nix = "0.29" clap = { version = "3.2", features = ["cargo"], optional = true } [dev-dependencies] diff --git a/src/context.rs b/src/context.rs index 4fb39ae..71fe374 100644 --- a/src/context.rs +++ b/src/context.rs @@ -12,7 +12,7 @@ //! use crate::{cstring_opt, ffi, sys_result, Device, Error, Result, Version}; -use nix::errno::{self, Errno}; +use nix::errno::Errno; use std::{ ffi::{CStr, CString}, os::raw::{c_char, c_uint}, @@ -361,7 +361,7 @@ impl Context { ffi::iio_context_get_attr(self.inner.ctx, idx as c_uint, &mut pname, &mut pval) }; if ret < 0 { - return Err(errno::from_i32(ret).into()); + return Err(Errno::from_raw(ret).into()); } let name = cstring_opt(pname); let val = cstring_opt(pval); diff --git a/src/lib.rs b/src/lib.rs index 262f915..ac69c04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ use std::{ }; use libiio_sys::{self as ffi}; -use nix::errno; +use nix::errno::Errno; pub use crate::buffer::{AttrIterator as BufferAttrIterator, Buffer}; pub use crate::channel::{ @@ -109,7 +109,7 @@ fn cstring_opt(pstr: *const c_char) -> Option { pub(crate) fn sys_result(ret: i32, result: T) -> Result { if ret < 0 { - Err(errno::from_i32(-ret).into()) + Err(Errno::from_raw(-ret).into()) } else { Ok(result)