]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-new.c
configure: replace ${CXXLAGS} with ${CXXFLAGS_for_sh}
[notmuch] / notmuch-new.c
index e5037761c8ee7f1b481f8aa342dddf5865874f65..2d975eb5b640f4561864372f64612f0e7d4fe94b 100644 (file)
@@ -281,6 +281,10 @@ add_file (notmuch_database_t *notmuch, const char *filename,
        fprintf (stderr, "Note: Ignoring non-mail file: %s\n", filename);
        break;
     /* Fatal issues. Don't process anymore. */
+    case NOTMUCH_STATUS_FILE_ERROR:
+       fprintf (stderr, "Unexpected error with file %s\n", filename);
+       (void) print_status_database ("add_file", notmuch, status);
+       goto DONE;
     case NOTMUCH_STATUS_READ_ONLY_DATABASE:
     case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
     case NOTMUCH_STATUS_OUT_OF_MEMORY:
@@ -347,7 +351,6 @@ add_files (notmuch_database_t *notmuch,
           const char *path,
           add_files_state_t *state)
 {
-    DIR *dir = NULL;
     struct dirent *entry = NULL;
     char *next = NULL;
     time_t fs_mtime, db_mtime;
@@ -651,8 +654,6 @@ add_files (notmuch_database_t *notmuch,
   DONE:
     if (next)
        talloc_free (next);
-    if (dir)
-       closedir (dir);
     if (fs_entries) {
        for (i = 0; i < num_fs_entries; i++)
            free (fs_entries[i]);