From: Carl Worth Date: Tue, 5 Jan 2010 23:23:52 +0000 (-0800) Subject: notmuch new: Avoid updating directory timestamp if interrupted. X-Git-Tag: 0.1~179 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=29908b9f1375904957e754531912d4ad12e94e74 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! --- diff --git a/notmuch-new.c b/notmuch-new.c index ca68a684..4adbdc7f 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -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)