X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fopen.cc;h=54510eace89b04a565a1b868af2d7f88d44f1e66;hp=a91d22efe6ecbf5e133dc1daded781229f9bf0a9;hb=3eb25c94bd8fe4065d6df6d665ee393cb9a0ad6f;hpb=063f5e98620e2f2adeaa8b3313cdac85eb4ef4db diff --git a/lib/open.cc b/lib/open.cc index a91d22ef..54510eac 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -661,16 +661,12 @@ notmuch_database_create_with_config (const char *database_path, err = mkdir (notmuch_path, 0755); if (err) { - if (errno == EEXIST) { - status = NOTMUCH_STATUS_DATABASE_EXISTS; - talloc_free (notmuch); - notmuch = NULL; - } else { + if (errno != EEXIST) { IGNORE_RESULT (asprintf (&message, "Error: Cannot create directory %s: %s.\n", notmuch_path, strerror (errno))); status = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; } - goto DONE; } }