aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix/PathV2.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/PathV2.inc')
-rw-r--r--lib/Support/Unix/PathV2.inc3
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();