Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
clang: error: unable to make temporary file: /etc/cc: can't make
unique filename: Permission denied
instead of
clang: error: unable to make temporary file: /etc/cc: can't make
unique filenamePermission denied
for example.
Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69626 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 4a6b505..6bcb00f 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -748,7 +748,7 @@
Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) {
if (0 != ::rename(path.c_str(), newName.c_str()))
return MakeErrMsg(ErrMsg, std::string("can't rename '") + path + "' as '" +
- newName.toString() + "' ");
+ newName.toString() + "'");
return false;
}
@@ -786,7 +786,7 @@
if (errno != EINTR && errno != EAGAIN) {
::close(inFile);
::close(outFile);
- return MakeErrMsg(ErrMsg, Src.toString()+": can't read source file: ");
+ return MakeErrMsg(ErrMsg, Src.toString()+": can't read source file");
}
} else {
char *BufPtr = Buffer;
@@ -797,7 +797,7 @@
::close(inFile);
::close(outFile);
return MakeErrMsg(ErrMsg, Dest.toString() +
- ": can't write destination file: ");
+ ": can't write destination file");
}
} else {
Amt -= AmtWritten;