]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/errno.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / common / errno.cc
index 69e54254bab1cad85553083e56f470c9eecc9dd9..83992361c437d4b5cc81002291275b07bee7d50d 100644 (file)
@@ -1,5 +1,6 @@
 #include "common/errno.h"
 #include "acconfig.h"
+#include "include/compat.h"
 
 #include <sstream>
 #include <string.h>
@@ -12,15 +13,8 @@ std::string cpp_strerror(int err)
   if (err < 0)
     err = -err;
   std::ostringstream oss;
-  buf[0] = '\0';
 
-  // strerror_r returns char * on Linux, and does not always fill buf
-#ifdef STRERROR_R_CHAR_P
-  errmsg = strerror_r(err, buf, sizeof(buf));
-#else
-  strerror_r(err, buf, sizeof(buf));
-  errmsg = buf;
-#endif
+  errmsg = ceph_strerror_r(err, buf, sizeof(buf));
 
   oss << "(" << err << ") " << errmsg;