Added on-interrupt.

This commit is contained in:
mainzelm 2002-05-08 12:04:56 +00:00
parent 18c056e01e
commit 6d09299c5d
2 changed files with 8 additions and 1 deletions

View File

@ -12,12 +12,14 @@
(files format-net))
(define-interface sunet-utilities-interface
(export host-name-or-ip))
(export host-name-or-ip
on-interrupt))
(define-structure sunet-utilities sunet-utilities-interface
(open scsh
scheme
format-net
sigevents
handle-fatal-error)
(files sunet-utilities))

View File

@ -9,3 +9,8 @@
(format-internet-host-address ip))))
(host-info:name (host-info addr))))
(define (on-interrupt interrupt thunk)
(let lp ((event (most-recent-sigevent)))
(let ((next (next-sigevent event interrupt)))
(thunk)
(lp next))))