unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Prevent data loss caused by SIGINT during notmuch new
@ 2010-03-26 21:18 Michal Sojka
  2010-03-27 23:37 ` Sebastian Spaeth
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Sojka @ 2010-03-26 21:18 UTC (permalink / raw)
  To: notmuch

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>
---
 notmuch-new.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index 44b50aa..ae89654 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -454,6 +454,9 @@ add_files_recursive (notmuch_database_t *notmuch,
 	next = NULL;
     }
 
+    if (state->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))
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-13 15:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 21:18 [PATCH] Prevent data loss caused by SIGINT during notmuch new Michal Sojka
2010-03-27 23:37 ` Sebastian Spaeth
2010-03-28  1:53   ` Sebastian Spaeth
2010-03-28  4:28     ` Michal Sojka
2010-03-29  7:16       ` Sebastian Spaeth
2010-03-29 23:20       ` spaetz
2010-03-30  8:22         ` Michal Sojka
2010-03-30  8:23           ` Michal Sojka
2010-04-13 15:47             ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).