[Support] Make sure LockFileManager works correctly with relative paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204426 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Argyrios Kyrtzidis
2014-03-21 02:31:56 +00:00
parent c53b3dbc20
commit fb307be5af
2 changed files with 40 additions and 1 deletions

View File

@@ -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;