use chmod portably in (system base compile)
authorJason Earl <jearl@notengoamigos.org>
Sun, 10 Mar 2013 19:12:05 +0000 (20:12 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 10 Mar 2013 19:12:09 +0000 (20:12 +0100)
* module/system/base/compile.scm (call-with-output-file/atomic): Call
  chmod with the file name instead of the port.

module/system/base/compile.scm

index db05d17..c522b74 100644 (file)
@@ -57,7 +57,9 @@
        (with-throw-handler #t
          (lambda ()
            (proc tmp)
-           (chmod tmp (logand #o0666 (lognot (umask))))
+           ;; Chmodding by name instead of by port allows this chmod to
+           ;; work on systems without fchmod, like MinGW.
+           (chmod template (logand #o0666 (lognot (umask))))
            (close-port tmp)
            (rename-file template filename))
          (lambda args