diff options
author | Michal Sojka <sojkam1@fel.cvut.cz> | 2010-03-30 10:23:23 +0200 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-13 08:44:34 -0700 |
commit | 423421526329f9c788e707301ee966eea911d261 (patch) | |
tree | 1ab6752fa5691d9f34ebf2a70763abf61c45d82a /notmuch-new.c | |
parent | 9ddde6eb14c126e314d90e2e08f213fb81f0457f (diff) |
Prevent data loss caused by SIGINT during notmuch new
When Ctrl-C is pressed in a wrong time during notmuch new, it can lead
to removal of messages from the database even if the files were not
removed.
It happened at least once to me.
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Diffstat (limited to 'notmuch-new.c')
-rw-r--r-- | notmuch-new.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/notmuch-new.c b/notmuch-new.c index 44b50aaa..484d9462 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -454,6 +454,9 @@ add_files_recursive (notmuch_database_t *notmuch, next = NULL; } + if (interrupted) + goto DONE; + /* Now that we've walked the whole filesystem list, anything left * over in the database lists has been deleted. */ while (notmuch_filenames_valid (db_files)) |