]> granicus.if.org Git - llvm/commit
[Support] Fix TempFile::discard to not leave behind temporary files
authorAndrew Ng <anng.sw@gmail.com>
Thu, 14 Feb 2019 11:08:49 +0000 (11:08 +0000)
committerAndrew Ng <anng.sw@gmail.com>
Thu, 14 Feb 2019 11:08:49 +0000 (11:08 +0000)
commit8bfdad6a76d34b0fd103888b20a5f1d184fc01ed
tree745432646b2e645820e45dfe7b9b443b3994dc83
parentf3757f24632ca48a611dec83e3624ac5b336c472
[Support] Fix TempFile::discard to not leave behind temporary files

Moved the remove of the temporary file to after the close to avoid
remove failures caused by ETXTBSY errors.

This issue was seen when FileOutputBuffer falls back to an in memory
buffer due to the inability to mmap the on disk file. This occurred when
running LLD on an Ubuntu VM in VirtualBox on a Windows host attempting
to write the output to a VirtualBox shared folder.

Differential Revision: https://reviews.llvm.org/D57960

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354017 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Path.cpp