diff options
| author | Steven Fackler <[email protected]> | 2016-10-16 21:07:17 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-16 21:07:17 -0700 |
| commit | 7ec015325b0d900ddaf375b62f5a52d4231dc9a2 (patch) | |
| tree | d2f369e718f2443cc220eb0c10693a64f7bed150 /openssl/src/bio.rs | |
| parent | ssl error handling cleanup (diff) | |
| download | rust-openssl-7ec015325b0d900ddaf375b62f5a52d4231dc9a2.tar.xz rust-openssl-7ec015325b0d900ddaf375b62f5a52d4231dc9a2.zip | |
Finish error overhaul
Diffstat (limited to 'openssl/src/bio.rs')
| -rw-r--r-- | openssl/src/bio.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openssl/src/bio.rs b/openssl/src/bio.rs index 22d2cee3..199fc0c8 100644 --- a/openssl/src/bio.rs +++ b/openssl/src/bio.rs @@ -4,6 +4,7 @@ use std::slice; use libc::c_int; use ffi; +use cvt_p; use error::ErrorStack; pub struct MemBioSlice<'a>(*mut ffi::BIO, PhantomData<&'a [u8]>); @@ -22,7 +23,7 @@ impl<'a> MemBioSlice<'a> { assert!(buf.len() <= c_int::max_value() as usize); let bio = unsafe { - try_ssl_null!(BIO_new_mem_buf(buf.as_ptr() as *const _, buf.len() as c_int)) + try!(cvt_p(BIO_new_mem_buf(buf.as_ptr() as *const _, buf.len() as c_int))) }; Ok(MemBioSlice(bio, PhantomData)) @@ -48,7 +49,7 @@ impl MemBio { ffi::init(); let bio = unsafe { - try_ssl_null!(ffi::BIO_new(ffi::BIO_s_mem())) + try!(cvt_p(ffi::BIO_new(ffi::BIO_s_mem()))) }; Ok(MemBio(bio)) } |