aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-04-30 12:25:33 -0400
committerGravatar David Bremner <bremner@debian.org>2012-05-05 10:11:57 -0300
commit5fddc07dc31481453c1af186bf7da241c00cdbf1 (patch)
treedfbe4bbabbac3b4c095c7528acdbcf54a2e3c78d /notmuch-show.c
parent1579fb334e0bbc42d5ae7692b184127f43ed7027 (diff)
lib/cli: Make notmuch_database_open return a status code
It has been a long-standing issue that notmuch_database_open doesn't return any indication of why it failed. This patch changes its prototype to return a notmuch_status_t and set an out-argument to the database itself, like other functions that return both a status and an object. In the interest of atomicity, this also updates every use in the CLI so that notmuch still compiles. Since this patch does not update the bindings, the Python bindings test fails.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 3b6667c4..95427d4f 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1081,9 +1081,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
return 1;
}
- notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
- NOTMUCH_DATABASE_MODE_READ_ONLY);
- if (notmuch == NULL)
+ if (notmuch_database_open (notmuch_config_get_database_path (config),
+ NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))
return 1;
query = notmuch_query_create (notmuch, query_string);