diff options
| author | David Bremner <david@tethera.net> | 2021-02-02 07:51:23 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-03-20 07:50:06 -0300 |
| commit | b30a59157d5ba0421c01fa3dc05d238d18738839 (patch) | |
| tree | 464383b5c40202a9aac11bb0be17d8d5061028ce /lib/database.cc | |
| parent | 74c3cc03c219f1046d2672ef686c91b3a7f8b806 (diff) | |
lib/compact: enable split config
This promotes _choose_xapian_path from static to extern linkage in
order to share between open.cc and database.cc.
Diffstat (limited to 'lib/database.cc')
| -rw-r--r-- | lib/database.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/database.cc b/lib/database.cc index 248d1dc2..9743c1ca 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -610,11 +610,12 @@ notmuch_database_compact_db (notmuch_database_t *notmuch, void *closure) { void *local; - char *notmuch_path, *xapian_path, *compact_xapian_path; + const char *xapian_path, *compact_xapian_path; const char *path; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; struct stat statbuf; bool keep_backup; + char *message; ret = _notmuch_database_ensure_writable (notmuch); if (ret) @@ -628,15 +629,9 @@ notmuch_database_compact_db (notmuch_database_t *notmuch, if (! local) return NOTMUCH_STATUS_OUT_OF_MEMORY; - if (! (notmuch_path = talloc_asprintf (local, "%s/%s", path, ".notmuch"))) { - ret = NOTMUCH_STATUS_OUT_OF_MEMORY; - goto DONE; - } - - if (! (xapian_path = talloc_asprintf (local, "%s/%s", notmuch_path, "xapian"))) { - ret = NOTMUCH_STATUS_OUT_OF_MEMORY; + ret = _notmuch_choose_xapian_path (local, path, &xapian_path, &message); + if (ret) goto DONE; - } if (! (compact_xapian_path = talloc_asprintf (local, "%s.compact", xapian_path))) { ret = NOTMUCH_STATUS_OUT_OF_MEMORY; |
