diff options
author | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-03-31 16:46:44 +0200 |
---|---|---|
committer | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-03-31 16:47:23 +0200 |
commit | e86bcf0d1055a98949bfbb2c73d6d538845a0401 (patch) | |
tree | 15aa561605751595f91452c4155fc308bfcad0c4 /openpgp-ffi/src/io.rs | |
parent | 3e8ddff9bbf0d97ac57cdb3fbc967a84fcb8ef7e (diff) |
ffi: Move around UNIX-specifix import
Diffstat (limited to 'openpgp-ffi/src/io.rs')
-rw-r--r-- | openpgp-ffi/src/io.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp-ffi/src/io.rs b/openpgp-ffi/src/io.rs index 953ec4b2..b2690db3 100644 --- a/openpgp-ffi/src/io.rs +++ b/openpgp-ffi/src/io.rs @@ -4,7 +4,7 @@ use std::fs::File; use std::io::{self, Read, Write, Cursor}; use std::path::Path; use std::slice; -use libc::{c_void, c_char, c_int, size_t, ssize_t, realloc}; +use libc::{c_void, c_char, size_t, ssize_t, realloc}; #[cfg(unix)] use std::os::unix::io::FromRawFd; @@ -54,7 +54,7 @@ pub extern "C" fn pgp_reader_from_file(errp: Option<&mut *mut crate::error::Erro /// Opens a file descriptor returning a reader. #[cfg(unix)] #[::sequoia_ffi_macros::extern_fn] #[no_mangle] -pub extern "C" fn pgp_reader_from_fd(fd: c_int) +pub extern "C" fn pgp_reader_from_fd(fd: libc::c_int) -> *mut Reader { ReaderKind::Generic(Box::new(unsafe { File::from_raw_fd(fd) @@ -222,7 +222,7 @@ fn pgp_writer_from_file(errp: Option<&mut *mut crate::error::Error>, /// Opens a file descriptor returning a writer. #[cfg(unix)] #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" -fn pgp_writer_from_fd(fd: c_int) -> *mut Writer { +fn pgp_writer_from_fd(fd: libc::c_int) -> *mut Writer { WriterKind::Generic(Box::new(unsafe { File::from_raw_fd(fd) })).move_into_raw() |