From 78981bb9bd66ba65af133fda6474664c330f30c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 17 Oct 2015 11:57:38 +0200 Subject: [PATCH] file-systems: Do not truncate mount points that already exist. Reported by David Thompson at . * gnu/build/file-systems.scm (mount-file-system): When SOURCE matches 'regular-file?', do not create MOUNT-POINT if it already exists. This fixes a bug whereby we would be truncating MOUNT-POINT if it already existed. --- gnu/build/file-systems.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 377bec278ebcdd68e01615c60c0206b17f9a5ff1..00af35d3df31c517e72f1e3ad954bb7a76ab275e 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -348,7 +348,7 @@ run a file system check." ;; in the case of a bind mount, a regular file may be needed. (if (and (= MS_BIND (logand flags MS_BIND)) (regular-file? source)) - (begin + (unless (file-exists? mount-point) (mkdir-p (dirname mount-point)) (call-with-output-file mount-point (const #t))) (mkdir-p mount-point))