X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=43cc4fb721012679c160b2f568f04714a8da6393;hp=8b3195984680fd948b1bae764ff1cf6068db9f83;hb=f336ee034be3c9518883dfb34db27529f4a4b83b;hpb=fca070f8ce72ac424a6494d9cf2763852f8b219c diff --git a/notmuch-new.c b/notmuch-new.c index 8b319598..43cc4fb7 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -193,6 +193,7 @@ add_files_recursive (notmuch_database_t *notmuch, next); break; /* Fatal issues. Don't process anymore. */ + case NOTMUCH_STATUS_READONLY_DATABASE: case NOTMUCH_STATUS_XAPIAN_EXCEPTION: case NOTMUCH_STATUS_OUT_OF_MEMORY: fprintf (stderr, "Error: %s. Halting processing.\n", @@ -407,11 +408,13 @@ notmuch_new_command (void *ctx, if (interrupted) return 1; + printf ("Found %d total files. \n", count); notmuch = notmuch_database_create (db_path); add_files_state.ignore_read_only_directories = FALSE; add_files_state.total_files = count; } else { - notmuch = notmuch_database_open (db_path); + notmuch = notmuch_database_open (db_path, + NOTMUCH_DATABASE_MODE_READ_WRITE); add_files_state.ignore_read_only_directories = TRUE; add_files_state.total_files = 0; } @@ -423,7 +426,6 @@ notmuch_new_command (void *ctx, dot_notmuch_path = NULL; add_files_state.saw_read_only_directory = FALSE; - add_files_state.total_files = 0; add_files_state.processed_files = 0; add_files_state.added_messages = 0; gettimeofday (&add_files_state.tv_start, NULL);