X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=55c3dc1d8d75c8873fb64308d2e72b5d63cb661e;hp=0d06253d9fb5221949ce6da83ac3d97d58ee4f0e;hb=c485c51585d8e51d289eb9830203fa322d7a0740;hpb=1c86b48329c0cd69b4353accda4d28739ec1c0f3 diff --git a/notmuch-new.c b/notmuch-new.c index 0d06253d..55c3dc1d 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -711,13 +711,6 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) } } - /* Setup our handler for SIGINT */ - memset (&action, 0, sizeof (struct sigaction)); - action.sa_handler = handle_sigint; - sigemptyset (&action.sa_mask); - action.sa_flags = SA_RESTART; - sigaction (SIGINT, &action, NULL); - config = notmuch_config_open (ctx, NULL, NULL); if (config == NULL) return 1; @@ -758,6 +751,15 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) if (notmuch == NULL) return 1; + /* Setup our handler for SIGINT. We do this after having + * potentially done a database upgrade we this interrupt handler + * won't support. */ + memset (&action, 0, sizeof (struct sigaction)); + action.sa_handler = handle_sigint; + sigemptyset (&action.sa_mask); + action.sa_flags = SA_RESTART; + sigaction (SIGINT, &action, NULL); + talloc_free (dot_notmuch_path); dot_notmuch_path = NULL;