Added on-interrupt.
This commit is contained in:
parent
18c056e01e
commit
6d09299c5d
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))))
|
||||
|
|
Loading…
Reference in New Issue