From f48ea2de68cabd283203219cf2393e2825fac8e9 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 24 Apr 2011 16:01:33 +0300 Subject: [PATCH] add a REMOVE-FD-HANDLER restart around calling the FD handler function Otherwise broken FD handlers are even more of a pain than they need to be. Makes bug lp#769162 less irritating, but doesn't actually fix it. --- src/code/serve-event.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/code/serve-event.lisp b/src/code/serve-event.lisp index e3563e6..2b72d84 100644 --- a/src/code/serve-event.lisp +++ b/src/code/serve-event.lisp @@ -322,7 +322,11 @@ happens. Server returns T if something happened and NIL otherwise. Timeout (ecase (handler-direction handler) (:input (sb!unix:fd-isset fd read-fds)) (:output (sb!unix:fd-isset fd write-fds))))))) - (funcall (handler-function handler) - (handler-descriptor handler))) + (with-simple-restart (remove-fd-handler "Remove ~S" handler) + (funcall (handler-function handler) + (handler-descriptor handler)) + (go :next)) + (remove-fd-handler handler) + :next) t)))))) -- 1.7.10.4