]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/directories/unix/unix.factor
Make unix-system-call retry the call immediately upon hitting EINTR. Use unix-system...
[factor.git] / basis / io / directories / unix / unix.factor
index 06ba73bb462b14d3f60517af57f3a2de1d58da35..b1f659675981f5d13d733ddabf4fed59a48859f7 100644 (file)
@@ -17,29 +17,29 @@ M: unix touch-file ( path -- )
     ] if ;
 
 M: unix move-file ( from to -- )
-    [ normalize-path ] bi@ rename io-error ;
+    [ normalize-path ] bi@ [ rename ] unix-system-call io-error ;
 
 M: unix delete-file ( path -- ) normalize-path unlink-file ;
 
 M: unix make-directory ( path -- )
-    normalize-path OCT: 777 mkdir io-error ;
+    normalize-path OCT: 777 [ mkdir ] unix-system-call io-error ;
 
 M: unix delete-directory ( path -- )
-    normalize-path rmdir io-error ;
+    normalize-path [ rmdir ] unix-system-call io-error ;
 
 M: unix copy-file ( from to -- )
     [ normalize-path ] bi@ call-next-method ;
 
 : with-unix-directory ( path quot -- )
-    [ opendir dup [ (io-error) ] unless ] dip
-    dupd curry swap '[ _ closedir io-error ] [ ] cleanup ; inline
+    [ [ opendir ] unix-system-call dup [ (io-error) ] unless ] dip
+    dupd curry swap '[ _ [ closedir ] unix-system-call io-error ] [ ] cleanup ; inline
 
 HOOK: find-next-file os ( DIR* -- byte-array )
 
 M: unix find-next-file ( DIR* -- byte-array )
     dirent <struct>
     f <void*>
-    [ readdir_r 0 = [ (io-error) ] unless ] 2keep
+    [ [ readdir_r ] unix-system-call 0 = [ (io-error) ] unless ] 2keep
     *void* [ drop f ] unless ;
 
 : dirent-type>file-type ( ch -- type )