Changeset 9803


Ignore:
Timestamp:
Jun 21, 2008, 3:47:49 PM (11 years ago)
Author:
gz
Message:

more precise error message in the consistency check in output-file-force-output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/l1-sysio.lisp

    r9117 r9803  
    537537(defun output-file-force-output (stream file-ioblock count finish-p)
    538538  ;; Check to see if we're where we think we should be.
    539   (let* ((curpos (file-ioblock-octet-pos file-ioblock)))
    540     (unless (eql curpos (file-octet-filepos file-ioblock))
    541       (error "Expected newpos to be ~d, fd is at ~d"
    542              curpos (file-octet-filepos file-ioblock)))
    543     (let* ((n (fd-stream-force-output stream file-ioblock count finish-p)))
    544       (incf (file-ioblock-octet-pos file-ioblock) (or n 0))
    545       n)))
     539  (let* ((curpos (file-ioblock-octet-pos file-ioblock))
     540         (fpos (file-octet-filepos file-ioblock)))
     541    (unless (eq curpos fpos)
     542      (if (< fpos 0)
     543        (stream-io-error stream (- fpos) "tell")
     544        (error "Expected curpos to be ~d, fd is at ~d" curpos fpos))))
     545  (let* ((n (fd-stream-force-output stream file-ioblock count finish-p)))
     546    (incf (file-ioblock-octet-pos file-ioblock) (or n 0))
     547    n))
    546548
    547549;;; Can't be sure where the underlying fd is positioned, so seek first.
Note: See TracChangeset for help on using the changeset viewer.