summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-07 01:23:39 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-07 01:23:39 +0000
commitf27da4e57863934aa4657d7d0360e753c3f8c4e8 (patch)
tree6e02d3dc3d3b22ebd5a45d6a558f44cb53911965 /llvm/lib/Support/Unix/PathV2.inc
parente5755beb47ddd28b6a7d948cea34a896fa1732d3 (diff)
downloadbcm5719-llvm-f27da4e57863934aa4657d7d0360e753c3f8c4e8.tar.gz
bcm5719-llvm-f27da4e57863934aa4657d7d0360e753c3f8c4e8.zip
Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set. llvm-svn: 121094
Diffstat (limited to 'llvm/lib/Support/Unix/PathV2.inc')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index c547e6606f7..fc6b3867d57 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/lib/Support/Unix/PathV2.inc
@@ -395,9 +395,10 @@ rety_open_create:
// Make the path absolute.
char real_path_buff[PATH_MAX + 1];
if (realpath(RandomPath.c_str(), real_path_buff) == NULL) {
+ int error = errno;
::close(RandomFD);
::unlink(RandomPath.c_str());
- return error_code(errno, system_category());
+ return error_code(error, system_category());
}
result_path.clear();
OpenPOWER on IntegriCloud