[llvm] r338755 - [Support] [NFC] change comment about retries in createUniqueEntity
Bob Haarman via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 2 11:27:21 PDT 2018
Author: inglorion
Date: Thu Aug 2 11:27:21 2018
New Revision: 338755
URL: http://llvm.org/viewvc/llvm-project?rev=338755&view=rev
Log:
[Support] [NFC] change comment about retries in createUniqueEntity
Rewording as requested on D50126 after the change was pushed.
Modified:
llvm/trunk/lib/Support/Path.cpp
Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=338755&r1=338754&r2=338755&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Thu Aug 2 11:27:21 2018
@@ -190,8 +190,10 @@ createUniqueEntity(const Twine &Model, i
ResultPath.push_back(0);
ResultPath.pop_back();
- // Limit the number of attempts we make, so that we don't infinite loop when
- // we run out of filenames that fit the model.
+ // Limit the number of attempts we make, so that we don't infinite loop. E.g.
+ // "permission denied" could be for a specific file (so we retry with a
+ // different name) or for the whole directory (retry would always fail).
+ // Checking which is racy, so we try a number of times, then give up.
std::error_code EC;
for (int Retries = 128; Retries > 0; --Retries) {
// Replace '%' with random chars.
More information about the llvm-commits
mailing list