X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Finternal.lisp;h=2067797ee2a92544355500927d445ed8b2fdcf4a;hb=f61f97e46fe7e35ae4802b9ee7a33e489282de1d;hp=4a846a8e201a001827f072e84f46f76cc04673d7;hpb=34652b637f023fb24cf76df53e6a1936e94ce9ec;p=sbcl.git diff --git a/contrib/sb-simple-streams/internal.lisp b/contrib/sb-simple-streams/internal.lisp index 4a846a8..2067797 100644 --- a/contrib/sb-simple-streams/internal.lisp +++ b/contrib/sb-simple-streams/internal.lisp @@ -354,7 +354,11 @@ ;; eagain into ;; sb-unix 11) - (= errno sb-unix:ewouldblock))) + (= errno + #-win32 + sb-unix:ewouldblock + #+win32 + sb-unix:eintr))) (sb-sys:wait-until-fd-usable fd :input nil) (go again)) (t (return (- -10 errno))))) @@ -473,11 +477,14 @@ (:io (values t t sb-unix:o_rdwr)) (:probe (values t nil sb-unix:o_rdonly))) (declare (type sb-int:index mask)) - (let ((name (cond ((sb-int:unix-namestring pathname input)) - ((and input (eq if-does-not-exist :create)) - (sb-int:unix-namestring pathname nil)) - ((and (eq direction :io) (not if-does-not-exist-given)) - (sb-int:unix-namestring pathname nil))))) + (let* ((phys (sb-int:physicalize-pathname (merge-pathnames pathname))) + (true (probe-file phys)) + (name (cond (true + (sb-ext:native-namestring true :as-file t)) + ((or (not input) + (and input (eq if-does-not-exist :create)) + (and (eq direction :io) (not if-does-not-exist-given))) + (sb-ext:native-namestring phys :as-file t))))) ;; Process if-exists argument if we are doing any output. (cond (output (unless if-exists-given @@ -561,9 +568,12 @@ (loop (multiple-value-bind (fd errno) (if name + #+win32 + (sb-win32:unixlike-open name mask mode) + #-win32 (sb-unix:unix-open name mask mode) (values nil sb-unix:enoent)) - (cond ((sb-int:fixnump fd) + (cond ((integerp fd) (when (eql if-exists :append) (sb-unix:unix-lseek fd 0 sb-unix:l_xtnd)) (return (values fd name original delete-original)))