diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-07 01:23:39 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-07 01:23:39 +0000 |
commit | f27da4e57863934aa4657d7d0360e753c3f8c4e8 (patch) | |
tree | 6e02d3dc3d3b22ebd5a45d6a558f44cb53911965 /llvm/lib/Support/Unix/PathV2.inc | |
parent | e5755beb47ddd28b6a7d948cea34a896fa1732d3 (diff) | |
download | bcm5719-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.inc | 3 |
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(); |