diff --git a/scsh/sighandlers.scm b/scsh/sighandlers.scm index 46b9b33..4b52c21 100644 --- a/scsh/sighandlers.scm +++ b/scsh/sighandlers.scm @@ -94,9 +94,10 @@ (set-enabled-interrupts before) return))) - -(define *interrupt-handlers-vector* - (make-vector number-of-interrupts #t)) +(define *interrupt-handlers-vector*) + +(define (install-fresh-interrupt-handlers-vector!) + (set! *interrupt-handlers-vector* (make-vector number-of-interrupts #t))) (define (interrupt-handlers-vector) *interrupt-handlers-vector*) @@ -162,11 +163,7 @@ (interrupt-handler-ref int)) (define (with-scsh-sighandlers interactive? thunk) - (do ((int 0 (+ int 1))) - ((= int number-of-interrupts)) - (set-interrupt-handler - int - (lambda a #f))) + (install-fresh-interrupt-handlers-vector!) (do ((sig 32 (- sig 1))) ((< sig 0)) (let ((i (%signal->interrupt sig)))