aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-01-05 15:23:52 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-01-06 10:32:06 -0800
commit29908b9f1375904957e754531912d4ad12e94e74 (patch)
tree5459617e455dcfb8bb10b971095c716e57950bd1
parent999f4c895c2442f50f943f6a8b391e1adc9cbba4 (diff)
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!
-rw-r--r--notmuch-new.c8
1 files changed, 5 insertions, 3 deletions
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)