--- src/code/fd-stream.lisp.~1.96.~ 2006-02-21 13:54:03.000000000 -0600 +++ src/code/fd-stream.lisp 2006-03-03 22:53:45.000000000 -0600 @@ -1585,15 +1585,21 @@ (sb!win32:fd-listen (fd-stream-fd fd-stream))) #!-win32 (setf (fd-stream-listen fd-stream) - (eql (sb!unix:with-restarted-syscall () - (sb!alien:with-alien ((read-fds (sb!alien:struct - sb!unix:fd-set))) - (sb!unix:fd-zero read-fds) - (sb!unix:fd-set (fd-stream-fd fd-stream) read-fds) - (sb!unix:unix-fast-select (1+ (fd-stream-fd fd-stream)) - (sb!alien:addr read-fds) - nil nil 0 0))) - 1)))) + (and (eql (sb!unix:with-restarted-syscall () + (sb!alien:with-alien ((read-fds (sb!alien:struct + sb!unix:fd-set))) + (sb!unix:fd-zero read-fds) + (sb!unix:fd-set (fd-stream-fd fd-stream) read-fds) + (sb!unix:unix-fast-select + (1+ (fd-stream-fd fd-stream)) + (sb!alien:addr read-fds) nil nil 0 0))) + 1) + ;; r-b/f too calls select, but it should not block + ;; as long as read can return once w/o blocking + (if (catch 'eof-input-catcher + (refill-buffer/fd fd-stream)) + t + :eof))))) (:unread (setf (fd-stream-unread fd-stream) arg1) (setf (fd-stream-listen fd-stream) t))