Raymond Toy pushed to branch issue-401-file-position-setter-wrong at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/fd-stream.lisp
    ... ... @@ -1699,7 +1699,7 @@
    1699 1699
     	      (posn errno)
    
    1700 1700
     	    (unix:unix-lseek (fd-stream-fd stream) 0 unix:l_incr)
    
    1701 1701
     	  (declare (type (or (integer 0) null) posn))
    
    1702
    -	  ;;#+nil
    
    1702
    +	  #+nil
    
    1703 1703
     	  (format t "lseek returns ~D ~D~%" posn errno)
    
    1704 1704
     	  (cond (posn
    
    1705 1705
     		 ;; Adjust for buffered output:
    
    ... ... @@ -1720,7 +1720,7 @@
    1720 1720
     		 (decf posn (- (fd-stream-ibuf-tail stream)
    
    1721 1721
     			       (fd-stream-ibuf-head stream)))
    
    1722 1722
     
    
    1723
    -		 ;;#+nil
    
    1723
    +		 #+nil
    
    1724 1724
     		 (format t "Updated posn = ~D~%" posn)
    
    1725 1725
     		 #+unicode
    
    1726 1726
     		 (when (fd-stream-string-buffer stream)
    
    ... ... @@ -1737,14 +1737,14 @@
    1737 1737
     		       ;; octet-count doesn't use that.  Hence,
    
    1738 1738
     		       ;; subtract one from string-index and
    
    1739 1739
     		       ;; string-buffer-len.
    
    1740
    -		       ;;#+nil
    
    1740
    +		       #+nil
    
    1741 1741
     		       (progn
    
    1742 1742
     			 (format t "~&ocount = ~D~%" ocount)
    
    1743 1743
     			 (format t "posn = ~D~%" posn))
    
    1744 1744
     		       (loop for k of-type fixnum from (1- (fd-stream-string-index stream))
    
    1745 1745
     			       below (1- (fd-stream-string-buffer-len stream))
    
    1746 1746
     			     do (decf posn (aref ocount k)))
    
    1747
    -		       ;;#+nil
    
    1747
    +		       #+nil
    
    1748 1748
     		       (progn
    
    1749 1749
     			 (format t "new posn = ~D~%" posn)
    
    1750 1750
     			 (format t "in-buffer-length = ~D~%" in-buffer-length)
    
    ... ... @@ -1760,23 +1760,19 @@
    1760 1760
     		   ;; string-buffer and no in-buffer, then the ibuf
    
    1761 1761
     		   ;; tail and head pointers contain all the
    
    1762 1762
     		   ;; information needed.
    
    1763
    -		   ;;#+nil
    
    1763
    +		   #+nil
    
    1764 1764
     		   (progn
    
    1765 1765
     		     (format t "in-buffer-length = ~D~%" in-buffer-length)
    
    1766 1766
     		     (format t "in-length = ~D~%" (fd-stream-in-length stream))
    
    1767 1767
     		     (format t "fd-stream-in-index = ~D~%" (fd-stream-in-index stream))
    
    1768 1768
     		     (format t "posn = ~A~%" posn))
    
    1769 1769
     		   (decf posn (- (fd-stream-in-length stream)
    
    1770
    -				 (fd-stream-in-index stream)))
    
    1771
    -		   (format t "After inbuffer update posn = ~A~%" posn))
    
    1772
    -		 ;;#+nil
    
    1770
    +				 (fd-stream-in-index stream))))
    
    1771
    +		 #+nil
    
    1773 1772
     		 (format t "fd-stream-unread = ~S~%" (fd-stream-unread stream))
    
    1774 1773
     		 (when (fd-stream-unread stream) ;;@@
    
    1775 1774
     		   (decf posn))
    
    1776 1775
     		 ;; Divide bytes by element size.
    
    1777
    -		 (format t "posn = ~A, size = ~A, trunc = ~A~%"
    
    1778
    -			 posn (fd-stream-element-size stream)
    
    1779
    -			 (truncate posn (fd-stream-element-size stream)))
    
    1780 1776
     		 (truncate posn (fd-stream-element-size stream)))
    
    1781 1777
     		((eq errno unix:espipe)
    
    1782 1778
     		 nil)