guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH shepherd v2] support: Ignore errors in mkdir-p when the directori


From: David Michael
Subject: [PATCH shepherd v2] support: Ignore errors in mkdir-p when the directories exist.
Date: Fri, 05 Feb 2016 13:23:49 -0500

* modules/shepherd/support.scm (mkdir-p): Don't throw errors when
  mkdir fails but the directory exists afterwards.
---
 modules/shepherd/support.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index 9bc5f5d..4059770 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -172,7 +172,8 @@ output port, and PROC's result is returned."
                  (mkdir path))
              (loop tail path))
            (lambda args
-             (if (= EEXIST (system-error-errno args))
+             (if (and (file-exists? path)
+                      (eq? (stat:type (stat path)) 'directory))
                  (loop tail path)
                  (apply throw args))))))
       (() #t))))
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]