summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2018-08-02 18:27:21 +0000
committerBob Haarman <llvm@inglorion.net>2018-08-02 18:27:21 +0000
commit112ebb687a283825ddadebe938841c483534cba8 (patch)
treec8744b0707a1dfe7cc7753828aa59a22268cb343 /llvm/lib/Support/Path.cpp
parente3d81572c14ad56ff7db586f71f3fca30a6169db (diff)
downloadbcm5719-llvm-112ebb687a283825ddadebe938841c483534cba8.tar.gz
bcm5719-llvm-112ebb687a283825ddadebe938841c483534cba8.zip
[Support] [NFC] change comment about retries in createUniqueEntity
Rewording as requested on D50126 after the change was pushed. llvm-svn: 338755
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index adba21b3bcd..99c90d79551 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -190,8 +190,10 @@ createUniqueEntity(const Twine &Model, int &ResultFD,
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.
OpenPOWER on IntegriCloud