| Index: runtime/vm/os_thread_linux.cc
|
| diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc
|
| index 470c3e348a265d3aa3ba965d6b6f17c884d1c9e7..2bf570902fd05657895de38beb6355911221b838 100644
|
| --- a/runtime/vm/os_thread_linux.cc
|
| +++ b/runtime/vm/os_thread_linux.cc
|
| @@ -13,27 +13,16 @@
|
| #include <sys/time.h> // NOLINT
|
|
|
| #include "platform/assert.h"
|
| +#include "platform/utils.h"
|
|
|
| namespace dart {
|
|
|
| -static char* strerror_helper(int err, char* buffer, size_t bufsize) {
|
| -#if !defined(__GLIBC__) || \
|
| - ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
|
| - // Use the standard version
|
| - return strerror_r(err, buffer, bufsize) == 0 ?
|
| - buffer : const_cast<char*>("strerror_r failed");
|
| -#else
|
| - // Use the gnu specific version
|
| - return strerror_r(err, buffer, bufsize);
|
| -#endif
|
| -}
|
| -
|
| #define VALIDATE_PTHREAD_RESULT(result) \
|
| if (result != 0) { \
|
| const int kBufferSize = 1024; \
|
| char error_buf[kBufferSize]; \
|
| FATAL2("pthread error: %d (%s)", result, \
|
| - strerror_helper(result, error_buf, kBufferSize)); \
|
| + Utils::StrError(result, error_buf, kBufferSize)); \
|
| }
|
|
|
|
|
| @@ -52,7 +41,7 @@ static char* strerror_helper(int err, char* buffer, size_t bufsize) {
|
| char error_buf[kBufferSize]; \
|
| fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
|
| __FILE__, __LINE__, result, \
|
| - strerror_helper(result, error_buf, kBufferSize)); \
|
| + Utils::StrError(result, error_buf, kBufferSize)); \
|
| return result; \
|
| }
|
| #else
|
|
|