mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Create temp. file in current path.
llvm-svn: 53973
This commit is contained in:
parent
89a4804599
commit
fb1364b2b5
@ -746,14 +746,11 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
|
||||
// Append an XXXXXX pattern to the end of the file for use with mkstemp,
|
||||
// mktemp or our own implementation.
|
||||
char *FNBuffer = (char*) alloca(path.size()+8);
|
||||
if (isDirectory()) {
|
||||
std::string dirPath = getDirname();
|
||||
strcpy(FNBuffer, dirPath.c_str());
|
||||
strcpy(FNBuffer+dirPath.size(), "XXXXXX");
|
||||
} else {
|
||||
path.copy(FNBuffer,path.size());
|
||||
if (isDirectory())
|
||||
strcpy(FNBuffer+path.size(), "/XXXXXX");
|
||||
else
|
||||
strcpy(FNBuffer+path.size(), "-XXXXXX");
|
||||
}
|
||||
|
||||
#if defined(HAVE_MKSTEMP)
|
||||
int TempFD;
|
||||
|
Loading…
Reference in New Issue
Block a user