diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-20 20:50:13 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-20 20:50:13 +0000 |
commit | 3222b9be0472bb72e1574d8d85bdc712aa8b84fa (patch) | |
tree | 58364f8692dea0fcaf08df33e15247a1502a3144 /llvm/lib/System/Unix/Unix.h | |
parent | e84a9daa1614b2b140283015a7308a518188b8c8 (diff) | |
download | bcm5719-llvm-3222b9be0472bb72e1574d8d85bdc712aa8b84fa.tar.gz bcm5719-llvm-3222b9be0472bb72e1574d8d85bdc712aa8b84fa.zip |
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/": ").
llvm-svn: 69626
Diffstat (limited to 'llvm/lib/System/Unix/Unix.h')
-rw-r--r-- | llvm/lib/System/Unix/Unix.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Unix.h b/llvm/lib/System/Unix/Unix.h index b2c3160a415..452226f4f79 100644 --- a/llvm/lib/System/Unix/Unix.h +++ b/llvm/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; } |