mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +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;
|
goto DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX this reads the config file twice, which is a bit wasteful */
|
if (! (notmuch->xapian_path = talloc_asprintf (notmuch, "%s/%s", notmuch_path, "xapian"))) {
|
||||||
status = notmuch_database_open_with_config (database_path,
|
status = NOTMUCH_STATUS_OUT_OF_MEMORY;
|
||||||
NOTMUCH_DATABASE_MODE_READ_WRITE,
|
goto DONE;
|
||||||
config_path,
|
}
|
||||||
|
|
||||||
|
status = _finish_open (notmuch,
|
||||||
profile,
|
profile,
|
||||||
¬much, &message);
|
NOTMUCH_DATABASE_MODE_READ_WRITE,
|
||||||
|
key_file,
|
||||||
|
&message);
|
||||||
if (status)
|
if (status)
|
||||||
goto DONE;
|
goto DONE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue