unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Michael <fedora.dm0@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH shepherd v2] support: Ignore errors in mkdir-p when the directories exist.
Date: Fri, 05 Feb 2016 13:23:49 -0500	[thread overview]
Message-ID: <87oabv3tje.fsf@gmail.com> (raw)

* 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	other threads:[~2016-02-05 18:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 18:23 David Michael [this message]
2016-02-06 13:22 ` [PATCH shepherd v2] support: Ignore errors in mkdir-p when the directories exist Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oabv3tje.fsf@gmail.com \
    --to=fedora.dm0@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).