From: Bartosz Szatkowski <bulislaw@linux.com>
To: linux-bluetooth@vger.kernel.org
Cc: Bartosz Szatkowski <bulislaw@linux.com>
Subject: [PATCH obexd 2/5] Fix ebook opening error handling
Date: Wed, 13 Jul 2011 22:10:07 +0000 [thread overview]
Message-ID: <1310595010-1033-2-git-send-email-bulislaw@linux.com> (raw)
In-Reply-To: <1310595010-1033-1-git-send-email-bulislaw@linux.com>
Individual address book may be not accessible (offline, not
authenticated etc.) it should not prevent plugin to load properly.
---
plugins/phonebook-ebook.c | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/plugins/phonebook-ebook.c b/plugins/phonebook-ebook.c
index b2f16e0..0b2878a 100644
--- a/plugins/phonebook-ebook.c
+++ b/plugins/phonebook-ebook.c
@@ -331,16 +331,16 @@ done:
static int traverse_sources(GSList *sources, char *default_src) {
GError *gerr;
- int status;
while (sources != NULL) {
EBook *ebook = e_book_new(E_SOURCE(sources->data), &gerr);
if (ebook == NULL) {
error("Can't create user's address book: %s",
gerr->message);
+ sources = sources->next;
- status = -EIO;
- goto fail;
+ g_error_free(gerr);
+ continue;
}
if (g_strcmp0(default_src, e_source_get_uri(
@@ -353,9 +353,11 @@ static int traverse_sources(GSList *sources, char *default_src) {
if (e_book_open(ebook, FALSE, &gerr) == FALSE) {
error("Can't open e-book address book: %s",
gerr->message);
+ sources = sources->next;
- status = -EIO;
- goto fail;
+ g_object_unref(ebook);
+ g_error_free(gerr);
+ continue;
}
if (default_src == NULL)
@@ -370,11 +372,6 @@ static int traverse_sources(GSList *sources, char *default_src) {
}
return 0;
-
-fail:
- g_error_free(gerr);
-
- return status;
}
int phonebook_init(void)
@@ -404,9 +401,7 @@ int phonebook_init(void)
GSList *sources = e_source_group_peek_sources(group);
- status = traverse_sources(sources, default_src);
- if (status != 0)
- goto fail;
+ traverse_sources(sources, default_src);
list = list->next;
}
--
1.7.5.3
next prev parent reply other threads:[~2011-07-13 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 22:10 [PATCH obexd 1/5] Fix pulling vCard for multiple ebooks Bartosz Szatkowski
2011-07-13 22:10 ` Bartosz Szatkowski [this message]
2011-07-13 22:10 ` [PATCH obexd 3/5] Add opening ebooks before each operation Bartosz Szatkowski
2011-07-13 22:10 ` [PATCH obexd 4/5] Fix no phone number in vCard listing Bartosz Szatkowski
2011-07-13 22:10 ` [PATCH obexd 5/5] Fix freeing buffer before transfer is complete Bartosz Szatkowski
2011-07-14 13:45 ` [PATCH obexd 1/5] Fix pulling vCard for multiple ebooks Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310595010-1033-2-git-send-email-bulislaw@linux.com \
--to=bulislaw@linux.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.