don't truncate .go files, do an atomic rename to prevent SIGBUS
authorAndy Wingo <wingo@pobox.com>
Sat, 9 Aug 2008 12:11:35 +0000 (14:11 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 9 Aug 2008 12:11:35 +0000 (14:11 +0200)
commite6d4e05cbda8445b86bccaa26b8604620cbe6412
treec59e04fc79dcb8ba9a5f14e1368adedec958f60a
parentfbea69ad42706c0ac755b89135e34fcf9586763f
don't truncate .go files, do an atomic rename to prevent SIGBUS

* module/system/base/compile.scm (call-with-output-file/atomic): New
  proc, outputs to a tempfile then does an atomic rename. Prevents SIGBUS
  if a compiled file is truncated and rewritten, as the file's objcode is
  mmap'd in.
  (compile-file): Use the new helper.
module/system/base/compile.scm