mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
lib/open: use _finish_open in n_d_create_with_config
This avoids reading the configuration file twice.
This commit is contained in:
parent
1be79fff50
commit
aa59424812
1 changed files with 10 additions and 6 deletions
14
lib/open.cc
14
lib/open.cc
|
@ -550,12 +550,16 @@ notmuch_database_create_with_config (const char *database_path,
|
|||
goto DONE;
|
||||
}
|
||||
|
||||
/* XXX this reads the config file twice, which is a bit wasteful */
|
||||
status = notmuch_database_open_with_config (database_path,
|
||||
NOTMUCH_DATABASE_MODE_READ_WRITE,
|
||||
config_path,
|
||||
if (! (notmuch->xapian_path = talloc_asprintf (notmuch, "%s/%s", notmuch_path, "xapian"))) {
|
||||
status = NOTMUCH_STATUS_OUT_OF_MEMORY;
|
||||
goto DONE;
|
||||
}
|
||||
|
||||
status = _finish_open (notmuch,
|
||||
profile,
|
||||
¬much, &message);
|
||||
NOTMUCH_DATABASE_MODE_READ_WRITE,
|
||||
key_file,
|
||||
&message);
|
||||
if (status)
|
||||
goto DONE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue