Avoid creating a redundant zero APInt.
[oota-llvm.git] / lib / System / Unix / Unix.h
index 29730fd10be1f59ca639fed13eda60d5ba9a02e3..b2c3160a415b3e551a348b3148d0e08d358a2f02 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Reid Spencer and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -70,7 +70,7 @@
 /// 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
-inline bool MakeErrMsg(
+static inline bool MakeErrMsg(
   std::string* ErrMsg, const std::string& prefix, int errnum = -1) {
   if (!ErrMsg)
     return true;
@@ -94,7 +94,7 @@ inline bool MakeErrMsg(
   // but, oh well, just use a generic message
   sprintf(buffer, "Error #%d", errnum);
 #endif
-  *ErrMsg = buffer;
+  *ErrMsg = prefix + buffer;
   return true;
 }