llvm-project/llvm/lib/Support/Windows
Rafael Espindola 20569e96e9 Delete temp file if rename fails.
Without this when lld failed to replace the output file it would leave
the temporary behind. The problem is that the existing logic is

- cancel the delete flag
- rename

We have to cancel first to avoid renaming and then crashing and
deleting the old version. What is missing then is deleting the
temporary file if the rename fails.

This can be an issue on both unix and windows, but I am not sure how
to cause the rename to fail reliably on unix. I think it can be done
on ZFS since it has an ACL system similar to what windows uses, but
adding support for checking that in llvm-lit is probably not worth it.

llvm-svn: 319786
2017-12-05 16:40:56 +00:00
..
COM.inc
DynamicLibrary.inc
Host.inc
Memory.inc [Support] Support NetBSD PaX MPROTECT in sys::Memory. 2017-11-16 23:04:44 +00:00
Mutex.inc
Path.inc Delete temp file if rename fails. 2017-12-05 16:40:56 +00:00
Process.inc [Support] env vars with empty values on windows 2017-08-18 16:55:44 +00:00
Program.inc Convenience/safety fix for llvm::sys::Execute(And|No)Wait 2017-09-13 17:03:37 +00:00
RWMutex.inc
Signals.inc
ThreadLocal.inc
Threading.inc
Watchdog.inc
WindowsSupport.h
explicit_symbols.inc