mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 14:30:34 +02:00
REPL Server: Don't establish a SIGINT handler.
* module/system/repl/server.scm (call-with-sigint): Remove. (accept-new-client): Don't wrap 'call-with-sigint' around call to 'accept'.
This commit is contained in:
parent
d0d8c872af
commit
e6c8e6047e
1 changed files with 1 additions and 18 deletions
|
@ -67,27 +67,10 @@
|
|||
(bind sock AF_UNIX path)
|
||||
sock))
|
||||
|
||||
(define call-with-sigint
|
||||
(if (not (provided? 'posix))
|
||||
(lambda (thunk) (thunk))
|
||||
(lambda (thunk)
|
||||
(let ((handler #f))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(set! handler
|
||||
(sigaction SIGINT (lambda (sig) (throw 'interrupt)))))
|
||||
thunk
|
||||
(lambda ()
|
||||
(if handler
|
||||
;; restore Scheme handler, SIG_IGN or SIG_DFL.
|
||||
(sigaction SIGINT (car handler) (cdr handler))
|
||||
;; restore original C handler.
|
||||
(sigaction SIGINT #f))))))))
|
||||
|
||||
(define* (run-server #:optional (server-socket (make-tcp-server-socket)))
|
||||
(define (accept-new-client)
|
||||
(catch #t
|
||||
(lambda () (call-with-sigint (lambda () (accept server-socket))))
|
||||
(lambda () (accept server-socket))
|
||||
(lambda (k . args)
|
||||
(cond
|
||||
((port-closed? server-socket)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue