Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5468:8e58322ef87e HEAD
Removed virtual mail_storage.get_last_error(). The implementation is always
the same.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 30 Mar 2007 21:57:34 +0300 |
parents | 89fb28593639 |
children | 35a54122b396 |
files | src/lib-storage/index/cydir/cydir-storage.c src/lib-storage/index/dbox/dbox-storage.c src/lib-storage/index/index-storage.c src/lib-storage/index/index-storage.h src/lib-storage/index/maildir/maildir-storage.c src/lib-storage/index/mbox/mbox-storage.c src/lib-storage/mail-storage-private.h src/lib-storage/mail-storage.c |
diffstat | 8 files changed, 11 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/cydir/cydir-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/cydir/cydir-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -436,8 +436,7 @@ NULL, NULL, cydir_mailbox_open, - cydir_mailbox_create, - index_storage_get_last_error + cydir_mailbox_create } };
--- a/src/lib-storage/index/dbox/dbox-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/dbox/dbox-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -578,8 +578,7 @@ NULL, dbox_autodetect, dbox_mailbox_open, - dbox_mailbox_create, - index_storage_get_last_error + dbox_mailbox_create } };
--- a/src/lib-storage/index/index-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/index-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -409,19 +409,6 @@ return mail_index_view_is_inconsistent(ibox->view); } -const char *index_storage_get_last_error(struct mail_storage *storage, - bool *syntax_error_r, - bool *temporary_error_r) -{ - *syntax_error_r = storage->syntax_error; - *temporary_error_r = storage->temporary_error; - - /* We get here only in error situations, so we have to return some - error. If storage->error is NULL, it means we forgot to set it at - some point.. */ - return storage->error != NULL ? storage->error : "Unknown error"; -} - void mail_storage_set_index_error(struct index_mailbox *ibox) { switch (mail_index_get_last_error(ibox->index)) {
--- a/src/lib-storage/index/index-storage.h Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/index-storage.h Fri Mar 30 21:57:34 2007 +0300 @@ -134,9 +134,6 @@ int index_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags); -const char *index_storage_get_last_error(struct mail_storage *storage, - bool *syntax_error_r, - bool *temporary_error_r); int index_storage_get_status(struct mailbox *box, enum mailbox_status_items items, struct mailbox_status *status);
--- a/src/lib-storage/index/maildir/maildir-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/maildir/maildir-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -1039,8 +1039,7 @@ NULL, maildir_autodetect, maildir_mailbox_open, - maildir_mailbox_create, - index_storage_get_last_error + maildir_mailbox_create } };
--- a/src/lib-storage/index/mbox/mbox-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/index/mbox/mbox-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -982,8 +982,7 @@ NULL, mbox_autodetect, mbox_mailbox_open, - mbox_mailbox_create, - index_storage_get_last_error + mbox_mailbox_create } };
--- a/src/lib-storage/mail-storage-private.h Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/mail-storage-private.h Fri Mar 30 21:57:34 2007 +0300 @@ -36,10 +36,6 @@ int (*mailbox_create)(struct mail_storage *storage, const char *name, bool directory); - - const char *(*get_last_error)(struct mail_storage *storage, - bool *syntax_error_r, - bool *temporary_error_r); }; union mail_storage_module_context {
--- a/src/lib-storage/mail-storage.c Fri Mar 30 21:55:41 2007 +0300 +++ b/src/lib-storage/mail-storage.c Fri Mar 30 21:57:34 2007 +0300 @@ -344,8 +344,13 @@ bool *syntax_error_r, bool *temporary_error_r) { - return storage->v.get_last_error(storage, syntax_error_r, - temporary_error_r); + *syntax_error_r = storage->syntax_error; + *temporary_error_r = storage->temporary_error; + + /* We get here only in error situations, so we have to return some + error. If storage->error is NULL, it means we forgot to set it at + some point.. */ + return storage->error != NULL ? storage->error : "Unknown error"; } const char *mail_storage_get_mailbox_path(struct mail_storage *storage,