Skip to content

Commit 501cca6

Browse files
adapting to alpine image
- time_t -> u64: see [1] - removing dynamic library as cdylib is unsupported [1] rust-lang/libc#1848
1 parent 015c8a2 commit 501cca6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ build:
7070

7171
install: build
7272
mkdir -p $(LIB_DIR) $(PKGCONFIG_DIR)
73-
$(INSTALL) $(LIB_DYNAMIC_PATH) $(LIB_DIR)
7473
$(INSTALL) $(LIB_STATIC_PATH) $(LIB_DIR)
7574
$(INSTALL) $(PKGCONFIG_PATH) $(PKGCONFIG_DIR)
7675

src/lib.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use libc::{
2525
c_char,
2626
c_uint,
2727
size_t,
28-
time_t,
2928
};
3029

3130
use chrono::LocalResult;
@@ -1205,7 +1204,7 @@ ffi!(fn pgp_encrypt_and_sign(session: *mut Session,
12051204
// PEP_STATUS _pgp_generate_keypair(PEP_SESSION session, pEp_identity *identity, time_t when)
12061205
ffi!(fn _pgp_generate_keypair(session: *mut Session,
12071206
identity: *mut PepIdentity,
1208-
when: time_t)
1207+
when: i64)
12091208
-> Result<()>
12101209
{
12111210
let session = Session::as_mut(session)?;
@@ -2005,7 +2004,7 @@ fn _pgp_key_expired(vc: &ValidCert) -> bool
20052004
// const time_t when, bool *expired)
20062005
ffi!(fn pgp_key_expired(session: *mut Session,
20072006
fpr: *const c_char,
2008-
when: time_t,
2007+
when: i64,
20092008
expiredp: *mut bool)
20102009
-> Result<()>
20112010
{
@@ -2226,7 +2225,7 @@ ffi!(fn pgp_get_key_rating(session: *mut Session, fpr: *const c_char,
22262225
// PEP_STATUS pgp_key_created(PEP_SESSION session, const char *fpr, time_t *created)
22272226
ffi!(fn pgp_key_created(session: *mut Session,
22282227
fpr: *const c_char,
2229-
createdp: *mut time_t)
2228+
createdp: *mut i64)
22302229
-> Result<()>
22312230
{
22322231
let session = Session::as_mut(session)?;
@@ -2241,7 +2240,7 @@ ffi!(fn pgp_key_created(session: *mut Session,
22412240
UnknownError,
22422241
"Creation time out of range")?.as_secs();
22432242

2244-
*createdp = t as time_t;
2243+
*createdp = t as i64;
22452244

22462245
Ok(())
22472246
});

0 commit comments

Comments
 (0)