Raymond Toy pushed to branch issue-365-add-strerror at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/unix.lisp
    ... ... @@ -2631,17 +2631,6 @@
    2631 2631
       (let ((result
    
    2632 2632
     	  (alien-funcall
    
    2633 2633
     	   (extern-alien "strerror"
    
    2634
    -			 (function (* unsigned-char) int))
    
    2634
    +			 (function (* char) int))
    
    2635 2635
     	   errno)))
    
    2636
    -    ;; We need to convert the set of octets to a Lisp string according
    
    2637
    -    ;; to the appropriate external format.  Copy the C string out to
    
    2638
    -    ;; an array which we can then convert to a string.
    
    2639
    -    (let* ((octets (make-array 100 :element-type '(unsigned-byte 8) :fill-pointer 0)))
    
    2640
    -      (loop for k from 0
    
    2641
    -	    for byte = (deref result k)
    
    2642
    -	    until (zerop byte)
    
    2643
    -	    do
    
    2644
    -	       (vector-push-extend byte octets))
    
    2645
    -      (lisp::with-array-data ((data octets) (start) (end))
    
    2646
    -	(declare (ignore start end))
    
    2647
    -	(values (stream:octets-to-string data :end (length octets)))))))
    2636
    +    (string-decode (cast result c-string) :default)))