summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-17 11:57:38 +0200
committerLudovic Courtès <ludo@gnu.org>2015-10-17 11:57:38 +0200
commit78981bb9bd66ba65af133fda6474664c330f30c4 (patch)
tree5b228e519e185aea3890d8eb125945f1e2b3fc78
parent0e3cc3116de1145545a51d598bece890eb6d8424 (diff)
downloadguix-78981bb9bd66ba65af133fda6474664c330f30c4.tar.gz
file-systems: Do not truncate mount points that already exist.
Reported by David Thompson <dthompson2@worcester.edu>
at <https://lists.gnu.org/archive/html/guix-devel/2015-10/msg00284.html>.

* 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.
-rw-r--r--gnu/build/file-systems.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 377bec278e..00af35d3df 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))