X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ffd-stream.lisp;h=69660e8b6e4b5dc4e946e0d652fa7d7e7e1d222f;hb=ad3beba970fab6e451a461c9f9b14faf4ef17718;hp=8e858f4d44bf38af9e4cd0c0b204e88a1ef860e9;hpb=56ee3433c3c2258e48fb799719688f29c71e05d4;p=sbcl.git diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 8e858f4..69660e8 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -638,22 +638,19 @@ (setf (fd-stream-ibuf-head stream) 0) (setf (fd-stream-ibuf-tail stream) tail)))) (setf (fd-stream-listen stream) nil) - (multiple-value-bind (count errno) - ;; FIXME: Judging from compiler warnings, this WITH-ALIEN form expands - ;; into something which uses the not-yet-defined type - ;; (SB!ALIEN-INTERNALS:ALIEN (* (SB!ALIEN:STRUCT SB!UNIX:FD-SET))). - ;; This is probably inefficient and unsafe and generally bad, so - ;; try to find some way to make that type known before - ;; this is compiled. - (sb!alien:with-alien ((read-fds (sb!alien:struct sb!unix:fd-set))) - (sb!unix:fd-zero read-fds) - (sb!unix:fd-set fd read-fds) - (sb!unix:unix-fast-select (1+ fd) - (sb!alien:addr read-fds) - nil - nil - 0 - 0)) + (sb!unix:with-restarted-syscall (count errno) + ;; FIXME: Judging from compiler warnings, this WITH-ALIEN form expands + ;; into something which uses the not-yet-defined type + ;; (SB!ALIEN-INTERNALS:ALIEN (* (SB!ALIEN:STRUCT SB!UNIX:FD-SET))). + ;; This is probably inefficient and unsafe and generally bad, so + ;; try to find some way to make that type known before + ;; this is compiled. + (sb!alien:with-alien ((read-fds (sb!alien:struct sb!unix:fd-set))) + (sb!unix:fd-zero read-fds) + (sb!unix:fd-set fd read-fds) + (sb!unix:unix-fast-select (1+ fd) + (sb!alien:addr read-fds) + nil nil 0 0)) (case count (1) (0 @@ -1515,13 +1512,14 @@ (fd-stream-ibuf-tail fd-stream))) (fd-stream-listen fd-stream) (setf (fd-stream-listen fd-stream) - (eql (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)) + (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)))) (:unread (setf (fd-stream-unread fd-stream) arg1) @@ -1602,16 +1600,14 @@ (setf (fd-stream-ibuf-tail fd-stream) 0) (catch 'eof-input-catcher (loop - (let ((count (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)))) + (let ((count (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))))) (cond ((eql count 1) (refill-buffer/fd fd-stream) (setf (fd-stream-ibuf-head fd-stream) 0) @@ -1774,7 +1770,7 @@ input-buffer-p dual-channel-p (name (if file - (format nil "file ~S" file) + (format nil "file ~A" file) (format nil "descriptor ~W" fd))) auto-close) (declare (type index fd) (type (or index null) timeout)