Added on-interrupt.
This commit is contained in:
parent
18c056e01e
commit
6d09299c5d
|
@ -12,12 +12,14 @@
|
||||||
(files format-net))
|
(files format-net))
|
||||||
|
|
||||||
(define-interface sunet-utilities-interface
|
(define-interface sunet-utilities-interface
|
||||||
(export host-name-or-ip))
|
(export host-name-or-ip
|
||||||
|
on-interrupt))
|
||||||
|
|
||||||
(define-structure sunet-utilities sunet-utilities-interface
|
(define-structure sunet-utilities sunet-utilities-interface
|
||||||
(open scsh
|
(open scsh
|
||||||
scheme
|
scheme
|
||||||
format-net
|
format-net
|
||||||
|
sigevents
|
||||||
handle-fatal-error)
|
handle-fatal-error)
|
||||||
(files sunet-utilities))
|
(files sunet-utilities))
|
||||||
|
|
||||||
|
|
|
@ -9,3 +9,8 @@
|
||||||
(format-internet-host-address ip))))
|
(format-internet-host-address ip))))
|
||||||
(host-info:name (host-info addr))))
|
(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