]> git.cworth.org Git - notmuch/blobdiff - lib/open.cc
lib/open: do not consider .notmuch alone as an existing database.
[notmuch] / lib / open.cc
index a942383b84b8cda800ae8006034555e267d11119..4dd62a9f25caafc5baec4803ee883e8bca333018 100644 (file)
@@ -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;
        }
     }