aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-03-28 23:49:31 +0300
committerMartin Storsjö <martin@martin.st>2022-04-11 19:46:40 +0300
commit64e4dd329c0c9d4c462594df004afd3102a54412 (patch)
tree6c7c913fecb77ca0a680f216d9c5d0f92d8c9715 /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
parentb9ca1e5a5a31a90afcecc02cd9555ed4ec9ff617 (diff)
downloadllvm-64e4dd329c0c9d4c462594df004afd3102a54412.zip
llvm-64e4dd329c0c9d4c462594df004afd3102a54412.tar.gz
llvm-64e4dd329c0c9d4c462594df004afd3102a54412.tar.bz2
[libcxx] [test] Fix back-to-back use of get_temp_file_name() on Windows
On non-Windows platforms, get_temp_file_name() uses `mkstemp()`, which picks a unique name and creates a file atomically. The Windows implementation uses `_mktemp_s()`, which doesn't create the file. The documentation of `_mktemp_s()` also says that by design, the function uses the same pattern within a process, as long as that file doesn't exist. Thus previously, two consecutive calls to `get_temp_file_name()` on Windows returned the same file name. Try to create the suggested temp file with `_O_EXCL` (marking the file name as already used for future calls to `_mktemp_s`) and retry if we weren't able to exclusively create the file. This fixes the test failures on Windows observed in D122257. Differential Revision: https://reviews.llvm.org/D122612
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
0 files changed, 0 insertions, 0 deletions