summaryrefslogtreecommitdiff
path: root/lib/System/Unix/Unix.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-20 20:50:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-20 20:50:13 +0000
commita7f2a9e69fc53920640c4707cc8c4045d9ea7db9 (patch)
tree9a8893f0fbd0381c4283d125b6596e58f264fe7e /lib/System/Unix/Unix.h
parent75397f4092f0884fa961ba2265cd6a4278c62991 (diff)
downloadllvm-a7f2a9e69fc53920640c4707cc8c4045d9ea7db9.tar.gz
llvm-a7f2a9e69fc53920640c4707cc8c4045d9ea7db9.tar.bz2
llvm-a7f2a9e69fc53920640c4707cc8c4045d9ea7db9.tar.xz
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
Diffstat (limited to 'lib/System/Unix/Unix.h')
-rw-r--r--lib/System/Unix/Unix.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/System/Unix/Unix.h b/lib/System/Unix/Unix.h
index b2c3160a41..452226f4f7 100644
--- a/lib/System/Unix/Unix.h
+++ b/lib/System/Unix/Unix.h
@@ -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;
}