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.
This commit is contained in:
Ludovic Courtès 2013-05-14 23:52:13 +02:00
parent 91fe0e20c7
commit 90a1e4b303

View file

@ -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))))