notmuch new: Avoid updating directory timestamp if interrupted.

This was a very dangerous bug. An interrupted "notmuch new" session
would still update the timestamp for the directory in the
database. This would result in mail files that were not processed due
to the original interruption *never* being picked up by future runs of
"notmuch new". Yikes!
This commit is contained in:
Carl Worth 2010-01-05 15:23:52 -08:00
parent 999f4c895c
commit 29908b9f13

View file

@ -290,9 +290,11 @@ add_files_recursive (notmuch_database_t *notmuch,
next = NULL;
}
status = notmuch_directory_set_mtime (directory, path_mtime);
if (status && ret == NOTMUCH_STATUS_SUCCESS)
ret = status;
if (! interrupted) {
status = notmuch_directory_set_mtime (directory, path_mtime);
if (status && ret == NOTMUCH_STATUS_SUCCESS)
ret = status;
}
DONE:
if (next)