This patch removes the internal check for directory existance in
create-directory, meaning that it can be treated as atomic on platforms where
mkdir(2) is.


--
richo || Today's excuse:

IRQ dropout
http://blog.psych0tik.net
From 3e1d5c55b3673403a8a1a69638ffe7083c09967c Mon Sep 17 00:00:00 2001
From: richo <ri...@psych0tik.net>
Date: Sun, 3 Feb 2013 02:14:24 +1100
Subject: [PATCH 1/2] create-directory: Remove the internal check for existance

This causes the EEXIST to be raised, and brings the unix implementation
inline with win32
---
 posixunix.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/posixunix.scm b/posixunix.scm
index 9de549f..7e5a9c5 100644
--- a/posixunix.scm
+++ b/posixunix.scm
@@ -766,8 +766,7 @@ EOF
   (lambda (name #!optional parents?)
     (##sys#check-string name 'create-directory)
     (let ((name (##sys#expand-home-path name)))
-      (unless (or (fx= 0 (##sys#size name))
-                 (file-exists? name))
+      (unless (fx= 0 (##sys#size name))
        (if parents?
            (let loop ((dir (let-values (((dir file ext) (decompose-pathname 
name)))
                              (if file (make-pathname dir file ext) dir))))
-- 
1.8.1.2

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to