guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: utils: 'set-file-time' passes AT_SYMLINK_NOFOLLOW.


From: guix-commits
Subject: 01/02: utils: 'set-file-time' passes AT_SYMLINK_NOFOLLOW.
Date: Sun, 13 Dec 2020 16:48:21 -0500 (EST)

civodul pushed a commit to branch core-updates
in repository guix.

commit b1e2ec008a463cc70fe15ee6c9e8b18dfa5e8e0d
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Dec 11 14:57:55 2020 +0100

    utils: 'set-file-time' passes AT_SYMLINK_NOFOLLOW.
    
    * guix/build/utils.scm (AT_SYMLINK_NOFOLLOW): New variable.
    (set-file-time): Use it.
---
 guix/build/utils.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 11ac6a8..9965106 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -924,13 +924,21 @@ a thunk."
                                              (min len buffer-size)
                                              buffer-size))))))
 
+(define AT_SYMLINK_NOFOLLOW
+  ;; Guile 2.0 did not define this constant, hence this hack.
+  (let ((variable (module-variable the-root-module 'AT_SYMLINK_NOFOLLOW)))
+    (if variable
+        (variable-ref variable)
+        256)))                                    ;for GNU/Linux
+
 (define (set-file-time file stat)
   "Set the atime/mtime of FILE to that specified by STAT."
   (utime file
          (stat:atime stat)
          (stat:mtime stat)
          (stat:atimensec stat)
-         (stat:mtimensec stat)))
+         (stat:mtimensec stat)
+         AT_SYMLINK_NOFOLLOW))
 
 (define (get-char* p)
   ;; We call it `get-char', but that's really a binary version



reply via email to

[Prev in Thread] Current Thread [Next in Thread]