aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/LockFileManager.cpp
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-10-24 01:26:22 +0000
committerBob Haarman <llvm@inglorion.net>2017-10-24 01:26:22 +0000
commit9ce2d03e5421979f9f007ec01d5aa429c36822ed (patch)
treea8015bd7c4e8e0d6b30bf383027547f881a786df /llvm/lib/Support/LockFileManager.cpp
parent0501f97cef778f7ebdb0441a359f62dbd93ca87d (diff)
downloadllvm-9ce2d03e5421979f9f007ec01d5aa429c36822ed.zip
llvm-9ce2d03e5421979f9f007ec01d5aa429c36822ed.tar.gz
llvm-9ce2d03e5421979f9f007ec01d5aa429c36822ed.tar.bz2
[raw_fd_ostream] report actual error in error messages
Summary: Previously, we would emit error messages like "IO failure on output stream". This change causes use to include information about what actually went wrong, e.g. "No space left on device". Reviewers: sunfish, rnk Reviewed By: rnk Subscribers: mehdi_amini, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39203 llvm-svn: 316404
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r--llvm/lib/Support/LockFileManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index 3ee3af7..81f3fd0 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -201,12 +201,11 @@ LockFileManager::LockFileManager(StringRef FileName)
Out.close();
if (Out.has_error()) {
- // We failed to write out PID, so make up an excuse, remove the
+ // We failed to write out PID, so report the error, remove the
// unique lock file, and fail.
- auto EC = make_error_code(errc::no_space_on_device);
std::string S("failed to write to ");
S.append(UniqueLockFileName.str());
- setError(EC, S);
+ setError(Out.error(), S);
sys::fs::remove(UniqueLockFileName);
return;
}