1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

Use source file permissions for compiled files

* module/system/base/compile.scm (call-with-output-file/atomic): Use the
  permissions of the source file, if available, as the permissions of
  the compiled file.  Fixes #18477.
This commit is contained in:
Andy Wingo 2016-06-21 17:51:07 +02:00
parent 8c8499a5e4
commit dde0d17f8e

View file

@ -59,7 +59,9 @@
(proc tmp)
;; Chmodding by name instead of by port allows this chmod to
;; work on systems without fchmod, like MinGW.
(chmod template (logand #o0666 (lognot (umask))))
(let ((perms (or (false-if-exception (stat:perms (stat reference)))
(lognot (umask)))))
(chmod template (logand #o0666 perms)))
(close-port tmp)
(rename-file template filename))
(lambda args