X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fserve-event.lisp;h=2046161d50e586c83450b675759062e2e446511b;hb=30d61cc04481c081fd97c42561475bfe11209b59;hp=b1b8aaf39382594f57e41a8455e2833b52c8cab3;hpb=7128169273aeacedc82848820d5f52112dcf253f;p=sbcl.git diff --git a/src/code/serve-event.lisp b/src/code/serve-event.lisp index b1b8aaf..2046161 100644 --- a/src/code/serve-event.lisp +++ b/src/code/serve-event.lisp @@ -119,19 +119,20 @@ (sb!unix:unix-fstat (handler-descriptor handler))) (setf (handler-bogus handler) t) (push handler bogus-handlers))) - (restart-case (error "~S ~[have~;has a~:;have~] bad file descriptor~:P." - bogus-handlers (length bogus-handlers)) - (remove-them () - :report "Remove bogus handlers." - (with-descriptor-handlers - (setf *descriptor-handlers* - (delete-if #'handler-bogus *descriptor-handlers*)))) - (retry-them () - :report "Retry bogus handlers." - (dolist (handler bogus-handlers) - (setf (handler-bogus handler) nil))) - (continue () - :report "Go on, leaving handlers marked as bogus."))) + (when bogus-handlers + (restart-case (error "~S ~[have~;has a~:;have~] bad file descriptor~:P." + bogus-handlers (length bogus-handlers)) + (remove-them () + :report "Remove bogus handlers." + (with-descriptor-handlers + (setf *descriptor-handlers* + (delete-if #'handler-bogus *descriptor-handlers*)))) + (retry-them () + :report "Retry bogus handlers." + (dolist (handler bogus-handlers) + (setf (handler-bogus handler) nil))) + (continue () + :report "Go on, leaving handlers marked as bogus.")))) nil) @@ -273,9 +274,15 @@ Shared between all threads, unless locally bound. EXPERIMENTAL.") ;; FIXME: Check for other errnos. Why do we return true ;; when interrupted? #!-win32 - (if (eql err sb!unix:eintr) - t - (handler-descriptors-error)) + (case err + (#.sb!unix:ebadf + (handler-descriptors-error)) + ((#.sb!unix:eintr #.sb!unix:eagain) + t) + (otherwise + (with-simple-restart (continue "Ignore failure and continue.") + (simple-perror "Unix system call select() failed" + :errno err)))) #!+win32 (handler-descriptors-error)) ((plusp value)