X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fopen.cc;h=4dd62a9f25caafc5baec4803ee883e8bca333018;hp=a942383b84b8cda800ae8006034555e267d11119;hb=25e0f5e59293ce961549201fdc74f81a3cc1675c;hpb=e43bad4883cf8a0c1d58d50238da599f9e170307 diff --git a/lib/open.cc b/lib/open.cc index a942383b..4dd62a9f 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -662,16 +662,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; } }