summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/LockFileManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-21 02:31:56 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-21 02:31:56 +0000
commit531a5be4d07328b9a1b61a4ddf1b1750b1e22a68 (patch)
treedf9d8f2f65ba51d31fb8085b533824d25ba13a46 /llvm/lib/Support/LockFileManager.cpp
parent275ce912439f0dd3d51feb9f48466378e70bbe85 (diff)
downloadbcm5719-llvm-531a5be4d07328b9a1b61a4ddf1b1750b1e22a68.tar.gz
bcm5719-llvm-531a5be4d07328b9a1b61a4ddf1b1750b1e22a68.zip
[Support] Make sure LockFileManager works correctly with relative paths.
llvm-svn: 204426
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r--llvm/lib/Support/LockFileManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index c8472d88055..55858473f59 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -11,6 +11,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <sys/stat.h>
#include <sys/types.h>
@@ -115,7 +116,8 @@ LockFileManager::LockFileManager(StringRef FileName)
while (1) {
// Create a link from the lock file name. If this succeeds, we're done.
error_code EC =
- sys::fs::create_link(UniqueLockFileName.str(), LockFileName.str());
+ sys::fs::create_link(sys::path::filename(UniqueLockFileName.str()),
+ LockFileName.str());
if (EC == errc::success)
return;
OpenPOWER on IntegriCloud