Skip to content

Commit

Permalink
lib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE
Browse files Browse the repository at this point in the history
Satisfies static analyzers
  • Loading branch information
cmouse authored and mrannanj committed Feb 20, 2018
1 parent f6a72b4 commit 603cac0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-storage/index/index-transaction.c
Expand Up @@ -26,7 +26,7 @@ index_transaction_index_commit(struct mail_index_transaction *index_trans,
struct mail_index_transaction_commit_result *result_r)
{
struct mailbox_transaction_context *t =
MAIL_STORAGE_CONTEXT(index_trans);
MAIL_STORAGE_CONTEXT_REQUIRE(index_trans);
struct index_mailbox_sync_pvt_context *pvt_sync_ctx = NULL;
const char *error;
int ret = 0;
Expand Down Expand Up @@ -104,7 +104,7 @@ static void
index_transaction_index_rollback(struct mail_index_transaction *index_trans)
{
struct mailbox_transaction_context *t =
MAIL_STORAGE_CONTEXT(index_trans);
MAIL_STORAGE_CONTEXT_REQUIRE(index_trans);

if (t->attr_pvt_trans != NULL)
dict_transaction_rollback(&t->attr_pvt_trans);
Expand Down
2 changes: 2 additions & 0 deletions src/lib-storage/mail-storage-private.h
Expand Up @@ -737,6 +737,8 @@ extern struct event_category event_category_mail;

#define MAIL_STORAGE_CONTEXT(obj) \
MODULE_CONTEXT(obj, mail_storage_mail_index_module)
#define MAIL_STORAGE_CONTEXT_REQUIRE(obj) \
MODULE_CONTEXT_REQUIRE(obj, mail_storage_mail_index_module)
extern MODULE_CONTEXT_DEFINE(mail_storage_mail_index_module,
&mail_index_module_register);

Expand Down

0 comments on commit 603cac0

Please sign in to comment.