dovecot: libstorage.a shouldn't reference symbols in libstorage_...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 2 02:00:48 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/f0623745bd4c
changeset: 7093:f0623745bd4c
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 02 01:59:32 2008 +0200
description:
libstorage.a shouldn't reference symbols in libstorage_index.a. Changed
index_storage_destroy_unrefed() call to be done by storage.destroy().

diffstat:

8 files changed, 12 insertions(+), 11 deletions(-)
src/lib-storage/index/cydir/cydir-storage.c     |    2 +-
src/lib-storage/index/dbox/dbox-storage.c       |    2 +-
src/lib-storage/index/index-storage.c           |    5 +++++
src/lib-storage/index/index-storage.h           |    1 +
src/lib-storage/index/maildir/maildir-storage.c |    2 +-
src/lib-storage/index/mbox/mbox-storage.c       |    2 +-
src/lib-storage/index/raw/raw-storage.c         |    2 +-
src/lib-storage/mail-storage.c                  |    7 +------

diffs (113 lines):

diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/cydir/cydir-storage.c
--- a/src/lib-storage/index/cydir/cydir-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/cydir/cydir-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -399,7 +399,7 @@ struct mail_storage cydir_storage = {
 		cydir_class_deinit,
 		cydir_alloc,
 		cydir_create,
-		NULL,
+		index_storage_destroy,
 		NULL,
 		cydir_mailbox_open,
 		cydir_mailbox_create
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/dbox/dbox-storage.c
--- a/src/lib-storage/index/dbox/dbox-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -510,7 +510,7 @@ struct mail_storage dbox_storage = {
 		dbox_class_deinit,
 		dbox_alloc,
 		dbox_create,
-		NULL,
+		index_storage_destroy,
 		NULL,
 		dbox_mailbox_open,
 		dbox_mailbox_create
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/index-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -235,6 +235,11 @@ void index_storage_destroy_unrefed(void)
 	destroy_unrefed(TRUE);
 }
 
+void index_storage_destroy(struct mail_storage *storage ATTR_UNUSED)
+{
+	index_storage_destroy_unrefed();
+}
+
 static void set_cache_decisions(const char *set, const char *fields,
 				enum mail_cache_decision_type dec)
 {
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/index-storage.h
--- a/src/lib-storage/index/index-storage.h	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/index-storage.h	Wed Jan 02 01:59:32 2008 +0200
@@ -97,6 +97,7 @@ index_storage_alloc(struct mail_storage 
 		    enum mailbox_open_flags flags, const char *prefix);
 void index_storage_unref(struct mail_index *index);
 void index_storage_destroy_unrefed(void);
+void index_storage_destroy(struct mail_storage *storage ATTR_UNUSED);
 
 void index_storage_mailbox_init(struct index_mailbox *ibox, const char *name,
 				enum mailbox_open_flags flags,
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -977,7 +977,7 @@ struct mail_storage maildir_storage = {
 		maildir_class_deinit,
 		maildir_alloc,
 		maildir_create,
-		NULL,
+		index_storage_destroy,
 		maildir_autodetect,
 		maildir_mailbox_open,
 		maildir_mailbox_create
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/mbox/mbox-storage.c
--- a/src/lib-storage/index/mbox/mbox-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -911,7 +911,7 @@ struct mail_storage mbox_storage = {
 		mbox_class_deinit,
 		mbox_alloc,
 		mbox_create,
-		NULL,
+		index_storage_destroy,
 		mbox_autodetect,
 		mbox_mailbox_open,
 		mbox_mailbox_create
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/index/raw/raw-storage.c
--- a/src/lib-storage/index/raw/raw-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/index/raw/raw-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -258,7 +258,7 @@ struct mail_storage raw_storage = {
 		raw_class_deinit,
 		raw_alloc,
 		raw_create,
-		NULL,
+		index_storage_destroy,
 		NULL,
 		raw_mailbox_open,
 		raw_mailbox_create
diff -r a31c0f6f4386 -r f0623745bd4c src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Wed Jan 02 01:42:32 2008 +0200
+++ b/src/lib-storage/mail-storage.c	Wed Jan 02 01:59:32 2008 +0200
@@ -9,7 +9,6 @@
 #include "mail-storage-private.h"
 #include "mail-namespace.h"
 #include "mail-search.h"
-#include "index/index-storage.h"
 
 #include <stdlib.h>
 #include <time.h>
@@ -266,14 +265,10 @@ void mail_storage_destroy(struct mail_st
 
 	*_storage = NULL;
 
-	if (storage->v.destroy != NULL)
-		storage->v.destroy(storage);
-
+	storage->v.destroy(storage);
 	mailbox_list_deinit(storage->list);
 	i_free(storage->error_string);
 	pool_unref(&storage->pool);
-
-	index_storage_destroy_unrefed();
 }
 
 void mail_storage_clear_error(struct mail_storage *storage)


More information about the dovecot-cvs mailing list