diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-13 21:22:49 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-13 21:22:49 +0000 |
commit | c2a981614e324fea7f0a0533f8f1d103cbd17f6d (patch) | |
tree | 07699b452b0b9064113913fcf8d21902ffdacaf7 /tools/CIndex/CIndexCodeCompletion.cpp | |
parent | b031c87ca32993fc54da732fced871bdd5b2a69e (diff) |
Revert 98439. There is a bad race condition in sys::Path::makeUnique on win32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/CIndex/CIndexCodeCompletion.cpp')
-rw-r--r-- | tools/CIndex/CIndexCodeCompletion.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/CIndex/CIndexCodeCompletion.cpp b/tools/CIndex/CIndexCodeCompletion.cpp index cd3787204c..3b7674ec0d 100644 --- a/tools/CIndex/CIndexCodeCompletion.cpp +++ b/tools/CIndex/CIndexCodeCompletion.cpp @@ -299,11 +299,15 @@ CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx, argv.push_back(NULL); // Generate a temporary name for the code-completion results file. - llvm::sys::Path ResultsFile(CIndexer::getTemporaryPath()); + char tmpFile[L_tmpnam]; + char *tmpFileName = tmpnam(tmpFile); + llvm::sys::Path ResultsFile(tmpFileName); TemporaryFiles.push_back(ResultsFile); // Generate a temporary name for the diagnostics file. - llvm::sys::Path DiagnosticsFile(CIndexer::getTemporaryPath()); + char tmpFileResults[L_tmpnam]; + char *tmpResultsFileName = tmpnam(tmpFileResults); + llvm::sys::Path DiagnosticsFile(tmpResultsFileName); TemporaryFiles.push_back(DiagnosticsFile); // Invoke 'clang'. |