mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -70,6 +70,9 @@
|
||||
/// string and the Unix error number given by \p errnum. If errnum is -1, the
|
||||
/// default then the value of errno is used.
|
||||
/// @brief Make an error message
|
||||
///
|
||||
/// If the error number can be converted to a string, it will be
|
||||
/// separated from prefix by ": ".
|
||||
static inline bool MakeErrMsg(
|
||||
std::string* ErrMsg, const std::string& prefix, int errnum = -1) {
|
||||
if (!ErrMsg)
|
||||
@@ -94,7 +97,7 @@ static inline bool MakeErrMsg(
|
||||
// but, oh well, just use a generic message
|
||||
sprintf(buffer, "Error #%d", errnum);
|
||||
#endif
|
||||
*ErrMsg = prefix + buffer;
|
||||
*ErrMsg = prefix + ": " + buffer;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user