[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 03/03: support: Adjust 'mkdir-p' to GNU/Hurd behavior.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 03/03: support: Adjust 'mkdir-p' to GNU/Hurd behavior. |
Date: |
Sat, 06 Feb 2016 13:20:29 +0000 |
civodul pushed a commit to branch master
in repository shepherd.
commit 66662cf695802575b195e12b03af172bcfaf1790
Author: Ludovic Courtès <address@hidden>
Date: Sat Feb 6 14:18:48 2016 +0100
support: Adjust 'mkdir-p' to GNU/Hurd behavior.
Reported by David Michael <address@hidden>.
* modules/shepherd/support.scm (mkdir-p): If we get an error other than
EEXIST but PATH exists and is a directory, keep going.
---
modules/shepherd/support.scm | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index 9bc5f5d..e50de74 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -172,7 +172,12 @@ output port, and PROC's result is returned."
(mkdir path))
(loop tail path))
(lambda args
- (if (= EEXIST (system-error-errno args))
+ ;; On GNU/Hurd we can get EROFS instead of EEXIST here. Thus, if
+ ;; we get something other than EEXIST, check whether PATH exists.
+ ;; See
<https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00049.html>.
+ (if (or (= EEXIST (system-error-errno args))
+ (let ((st (stat path #f)))
+ (and st (eq? 'directory (stat:type st)))))
(loop tail path)
(apply throw args))))))
(() #t))))