mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-01 18:12:49 +00:00
revert r128199 until it can be made to work with Frontend/dependency-gen.c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9035484200
commit
0a828fd7ef
@ -93,8 +93,7 @@ namespace sys {
|
|||||||
namespace fs {
|
namespace fs {
|
||||||
|
|
||||||
error_code current_path(SmallVectorImpl<char> &result) {
|
error_code current_path(SmallVectorImpl<char> &result) {
|
||||||
// Reserve an arbitrary amount of space.
|
result.reserve(MAXPATHLEN);
|
||||||
result.reserve(128);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (::getcwd(result.data(), result.capacity()) == 0) {
|
if (::getcwd(result.data(), result.capacity()) == 0) {
|
||||||
@ -418,13 +417,18 @@ rety_open_create:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make the path absolute.
|
// Make the path absolute.
|
||||||
if (error_code ec = make_absolute(RandomPath)) {
|
char real_path_buff[PATH_MAX + 1];
|
||||||
|
if (realpath(RandomPath.c_str(), real_path_buff) == NULL) {
|
||||||
|
int error = errno;
|
||||||
::close(RandomFD);
|
::close(RandomFD);
|
||||||
::unlink(RandomPath.c_str());
|
::unlink(RandomPath.c_str());
|
||||||
return ec;
|
return error_code(error, system_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
result_path = RandomPath;
|
result_path.clear();
|
||||||
|
StringRef d(real_path_buff);
|
||||||
|
result_path.append(d.begin(), d.end());
|
||||||
|
|
||||||
result_fd = RandomFD;
|
result_fd = RandomFD;
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user