diff options
| author | David Bremner <david@tethera.net> | 2014-12-27 19:12:49 +0100 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-29 00:34:15 +0100 |
| commit | 84d3b15d251623cbb66e5eca7ddb8d61aa596d33 (patch) | |
| tree | 73e7cca41e1b9e720f1e57eea58dc56e496cb4a3 /notmuch-new.c | |
| parent | 83298fa0f8e7717a260c1f88edd7bf545709562d (diff) | |
lib: add "verbose" versions of notmuch_database_{open,create}
The compatibility wrapper ensures that clients calling
notmuch_database_open will receive consistent output for now.
The changes to notmuch-{new,search} and test/symbol-test are just to
make the test suite pass.
The use of IGNORE_RESULT is justified by two things. 1) I don't know
what else to do. 2) asprintf guarantees the output string is NULL if
an error occurs, so at least we are not passing garbage back.
Diffstat (limited to 'notmuch-new.c')
| -rw-r--r-- | notmuch-new.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/notmuch-new.c b/notmuch-new.c index ddf42c14..e6c283eb 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -985,9 +985,16 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; add_files_state.total_files = count; } else { - if (notmuch_database_open (db_path, NOTMUCH_DATABASE_MODE_READ_WRITE, - ¬much)) + char *status_string = NULL; + if (notmuch_database_open_verbose (db_path, NOTMUCH_DATABASE_MODE_READ_WRITE, + ¬much, &status_string)) { + if (status_string) { + fputs (status_string, stderr); + free (status_string); + } + return EXIT_FAILURE; + } if (notmuch_database_needs_upgrade (notmuch)) { time_t now = time (NULL); |
