REPL Server: Don't establish a SIGINT handler.
authorMark H Weaver <mhw@netris.org>
Tue, 21 Jan 2014 21:06:40 +0000 (16:06 -0500)
committerMark H Weaver <mhw@netris.org>
Tue, 21 Jan 2014 21:11:17 +0000 (16:11 -0500)
* module/system/repl/server.scm (call-with-sigint): Remove.
  (accept-new-client): Don't wrap 'call-with-sigint' around call to
  'accept'.

module/system/repl/server.scm

index ec90677..2df7564 100644 (file)
     (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)