[balsa] Show file name in error message
- From: Peter Bloomfield <PeterB src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [balsa] Show file name in error message
- Date: Wed, 19 Aug 2009 23:37:42 +0000 (UTC)
commit c6a7275cbcb12e282bf93133bf57274f43a7a6c5
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Aug 19 19:37:35 2009 -0400
Show file name in error message
ChangeLog | 6 ++++++
libbalsa/address-book-gpe.c | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f081d2b..fd7242c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-08-19 Peter Bloomfield
+ * libbalsa/address-book-gpe.c
+ (libbalsa_address_book_gpe_open_db): show file name in error
+ message.
+
+2009-08-19 Peter Bloomfield
+
* src/main-window.c: Manage sensitivity of "Get New Mail"
action.
* src/main.c (mw_message_received_cb, main): ditto.
diff --git a/libbalsa/address-book-gpe.c b/libbalsa/address-book-gpe.c
index efbad1a..afc61fe 100644
--- a/libbalsa/address-book-gpe.c
+++ b/libbalsa/address-book-gpe.c
@@ -196,21 +196,21 @@ libbalsa_address_book_gpe_open_db(LibBalsaAddressBookGpe * ab)
{
#ifdef HAVE_SQLITE3
gchar *dir, *name;
- int r;
dir = g_build_filename(g_get_home_dir(), ".gpe", NULL);
mkdir(dir, S_IRUSR|S_IWUSR|S_IXUSR);
name = g_build_filename(dir, "contacts", NULL);
g_free(dir);
- r = sqlite3_open(name, &ab->db);
- g_free(name);
- if (r != SQLITE_OK) {
- printf("Cannot open: %s\n", sqlite3_errmsg(ab->db));
+ if (sqlite3_open(name, &ab->db) != SQLITE_OK) {
+ printf("Cannot open \"%s\": %s\n", name, sqlite3_errmsg(ab->db));
+ g_free(name);
sqlite3_close(ab->db);
ab->db = NULL;
return 0;
}
+ g_free(name);
+
sqlite3_exec(ab->db, schema_str, NULL, NULL, NULL);
sqlite3_exec(ab->db, schema2_str, NULL, NULL, NULL);
#else /* HAVE_SQLITE3 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]