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 | 69cbbbf005e75547de5cf0620278a954b2e65add (patch) | |
tree | ba08b8c1243f3b5855cec7409a940320acb5e2c3 /lib/Support/Unix | |
parent | 79c3c3a1dece6408e45933ba575e05ceb6208235 (diff) |
Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r-- | lib/Support/Unix/PathV2.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index c547e6606f..fc6b3867d5 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/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(); |