0.8.20.6:
[sbcl.git] / contrib / sb-simple-streams / file.lisp
index 22099af..2e20b2a 100644 (file)
@@ -14,7 +14,7 @@
 ;;;
 ;;; Definition of File-Simple-Stream and relations
 
-(def-stream-class file-simple-stream (single-channel-simple-stream)
+(def-stream-class file-simple-stream (single-channel-simple-stream file-stream)
   ((pathname :initform nil :initarg :pathname)
    (filename :initform nil :initarg :filename)
    (original :initform nil :initarg :original)
            (sb-ext:cancel-finalization stream)
            (error "Error fstating ~S: ~A" stream
                   (sb-int:strerror dev)))
-         (when (> size most-positive-fixnum)
+         (when (>= size most-positive-fixnum)
            ;; Or else BUF-LEN has to be a general integer, or
            ;; maybe (unsigned-byte 32).  In any case, this means
            ;; BUF-MAX and BUF-PTR have to be the same, which means
            ;; bigger files, anyway.  Maybe DEVICE-READ can adjust
            ;; the mapped portion of the file when necessary?
            (warn "Unable to memory-map entire file.")
-           (setf size most-positive-fixnum))
+           (setf size (1- most-positive-fixnum)))
          (let ((buffer
                 (handler-case
                   (sb-posix:mmap nil size prot sb-posix::MAP-SHARED fd 0)