From 90a1e4b3033e4a17a4b05f51f046a0eaa697c95b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Tue, 14 May 2013 23:52:13 +0200
Subject: [PATCH] package: Always clear the SIGINT handler.

* guix/scripts/package.scm (call-with-sigint-handler): Wrap THUNK in
  `dynamic-wind' so that the SIGINT handler is always cleared.
---
 guix/scripts/package.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 094d348ac93..aeeeab307c3 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -295,7 +295,10 @@ (define (call-with-sigint-handler thunk handler)
                         (lambda (signum)
                           (sigaction SIGINT SIG_DFL)
                           (abort-to-prompt %sigint-prompt signum)))
-                      (thunk))
+                      (dynamic-wind
+                        (const #t)
+                        thunk
+                        (cut sigaction SIGINT SIG_DFL)))
                     (lambda (k signum)
                       (handler signum))))
 
-- 
GitLab