Return bool from export_self_keys

This commit is contained in:
Alexander Krotov
2019-09-12 12:55:48 +03:00
parent d978a8e0a2
commit 3932d8f48f

View File

@@ -520,7 +520,7 @@ pub unsafe fn dc_job_do_DC_JOB_IMEX_IMAP(context: &Context, job: &Job) {
if ok_to_continue { if ok_to_continue {
match what { match what {
1 => { 1 => {
if 0 != export_self_keys(context, param1.as_ptr()) { if export_self_keys(context, param1.as_ptr()) {
info!(context, "Import/export completed.",); info!(context, "Import/export completed.",);
success = 1 success = 1
} }
@@ -1004,8 +1004,7 @@ unsafe fn import_self_keys(context: &Context, dir_name: *const libc::c_char) ->
imported_cnt imported_cnt
} }
// TODO should return bool /rtn unsafe fn export_self_keys(context: &Context, dir: *const libc::c_char) -> bool {
unsafe fn export_self_keys(context: &Context, dir: *const libc::c_char) -> libc::c_int {
let mut export_errors = 0; let mut export_errors = 0;
context context
@@ -1047,11 +1046,7 @@ unsafe fn export_self_keys(context: &Context, dir: *const libc::c_char) -> libc:
) )
.unwrap(); .unwrap();
if export_errors == 0 { export_errors == 0
1
} else {
0
}
} }
/******************************************************************************* /*******************************************************************************