X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffd-stream.lisp;h=2fbafbf86018ee69e6ca700585fae7c39d1ee705;hb=c3699db2053ff3b5ac6a98d4431c3789496002d8;hp=cc718510a03252e3d626f4618848d49cd131d216;hpb=c177b7710a9a8668f3bf8567726370b7dbb41726;p=sbcl.git diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index cc71851..2fbafbf 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -214,6 +214,11 @@ (+ (fd-stream-obuf-tail stream) ,size)) (flush-output-buffer stream))) + ,(unless (eq (car buffering) :none) + `(when (> (fd-stream-ibuf-tail stream) + (fd-stream-ibuf-head stream)) + (file-position stream (file-position stream)))) + ,@body (incf (fd-stream-obuf-tail stream) ,size) ,(ecase (car buffering) @@ -305,6 +310,9 @@ (let ((start (or start 0)) (end (or end (length (the (simple-array * (*)) thing))))) (declare (type index start end)) + (when (> (fd-stream-ibuf-tail fd-stream) + (fd-stream-ibuf-head fd-stream)) + (file-position fd-stream (file-position fd-stream))) (let* ((len (fd-stream-obuf-length fd-stream)) (tail (fd-stream-obuf-tail fd-stream)) (space (- len tail)) @@ -871,7 +879,6 @@ (:element-type (fd-stream-element-type fd-stream)) (:interactive-p - ;; FIXME: sb!unix:unix-isatty is undefined. (= 1 (the (member 0 1) (sb!unix:unix-isatty (fd-stream-fd fd-stream))))) (:line-length @@ -1226,7 +1233,7 @@ (open-error "~@" pathname)) (t nil))) - ((and (eql errno sb!unix:eexist) if-exists) + ((and (eql errno sb!unix:eexist) (null if-exists)) nil) (t (vanilla-open-error)))))))))