From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: <87oabv3tje.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRl2t-0004LU-Fb for guix-devel@gnu.org; Fri, 05 Feb 2016 13:23:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRl2s-00049j-Jd for guix-devel@gnu.org; Fri, 05 Feb 2016 13:23:51 -0500 Received: from mail-qg0-x243.google.com ([2607:f8b0:400d:c04::243]:34883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRl2s-00049f-FF for guix-devel@gnu.org; Fri, 05 Feb 2016 13:23:50 -0500 Received: by mail-qg0-x243.google.com with SMTP id b35so4639496qge.2 for ; Fri, 05 Feb 2016 10:23:50 -0800 (PST) Received: from callisto ([2601:47:4001:be5e:9afe:94ff:fe42:121e]) by smtp.gmail.com with ESMTPSA id v70sm8410598qkl.15.2016.02.05.10.23.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 10:23:49 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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