Changeset 10184


Ignore:
Timestamp:
Jul 23, 2008, 12:21:20 PM (11 years ago)
Author:
gb
Message:

FD-WRITE needs an IGNORING-EINTR, and has for some time. (Was fixed
in working-0711, but not here.)

Likewise, propagate some utf-8 memory encode/decode fixes here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-io.lisp

    r10151 r10184  
    8585                   (logior #x80 (the fixnum (logand #x3f (the fixnum (ash code -6))))))
    8686             (setf (%get-unsigned-byte pointer (the fixnum (+ idx 3)))
    87                    (logand #x3f code))
     87                   (logior #x80 (logand #x3f code)))
    8888             (incf idx 4))))))
    8989
     
    151151        (end (+ start noctets))
    152152        (nchars 0 (1+ nchars)))
    153        ((= i end) (values nchars i))
     153       ((= i end) (values nchars (- i start)))
    154154    (let* ((code (%get-unsigned-byte pointer i))
    155            (nexti (+ i (cond ((< code #x80) 1)
     155           (nexti (+ i (cond ((< code #xc2) 1)
    156156                             ((< code #xe0) 2)
    157157                             ((< code #xf0) 3)
    158                              (t 4)))))
     158                             ((< code #xf8) 4)
     159                             (t 1)))))
    159160      (declare (type (unsigned-byte 8) code))
    160161      (if (> nexti end)
    161         (return (values nchars i))
     162        (return (values nchars (- i start)))
    162163        (setq i nexti)))))
    163164
     
    166167;;; write nbytes bytes from buffer buf to file-descriptor fd.
    167168(defun fd-write (fd buf nbytes)
    168   (ignoring-eintr (syscall syscalls::write fd buf nbytes)))
     169  (ignoring-eintr
     170   (syscall syscalls::write fd buf nbytes)))
    169171
    170172(defun fd-read (fd buf nbytes)
Note: See TracChangeset for help on using the changeset viewer.