Skip to content

Commit

Permalink
#218: fix exit code for doveadm revert.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrse committed Nov 26, 2018
1 parent ca3710a commit 1a8ed24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/librmb/rados-storage-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ bool RadosStorageImpl::wait_for_write_operations_complete(
case WAIT_FOR_SAFE_AND_CB:
map_it->first->wait_for_safe_and_cb();
break;
default:
map_it->first->wait_for_complete_and_cb();
break;
}

failed = map_it->first->get_return_value() < 0 || failed ? true : false;
Expand Down
5 changes: 3 additions & 2 deletions src/storage-rbox/doveadm-rbox-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ static int restore_index_entry(struct mail_user *user, const char *mailbox_name,
/* add to index */
#if DOVECOT_PREREQ(2, 3)

if ((save_ctx->transaction->flags & MAILBOX_TRANSACTION_FLAG_FILL_IN_STUB) == 0) {
mail_index_append(save_ctx->transaction->itrans, next_uid, &seq);
} else {
seq = save_ctx->data.stub_seq;
Expand Down Expand Up @@ -590,7 +589,9 @@ static int cmd_rmb_revert_log_run(struct doveadm_mail_cmd_context *ctx, struct m
}
std::map<std::string, std::list<librmb::RadosSaveLogEntry>> moved_items;
ctx->exit_code = librmb::RmbCommands::delete_with_save_log(log_file, plugin.config->get_rados_cluster_name(),
plugin.config->get_rados_username(), &moved_items);
plugin.config->get_rados_username(), &moved_items) >= 0
? 0
: -1;

for (std::map<std::string, std::list<librmb::RadosSaveLogEntry>>::iterator iter = moved_items.begin();
iter != moved_items.end(); ++iter) {
Expand Down

0 comments on commit 1a8ed24

Please sign in to comment.