Revert "More pthreads cleanup."
This reverts commit 2a1bb4e64677b9abbc17173c79768ed494565047
Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
diff --git a/libc/bionic/strerror_r.cpp b/libc/bionic/strerror_r.cpp
index 81120ec..646cc52 100644
--- a/libc/bionic/strerror_r.cpp
+++ b/libc/bionic/strerror_r.cpp
@@ -7,8 +7,6 @@
#include <stdio.h>
#include <string.h>
-#include "private/ErrnoRestorer.h"
-
struct Pair {
int code;
const char* msg;
@@ -44,7 +42,7 @@
}
int strerror_r(int error_number, char* buf, size_t buf_len) {
- ErrnoRestorer errno_restorer;
+ int saved_errno = errno;
size_t length;
const char* error_name = __strerror_lookup(error_number);
@@ -54,10 +52,11 @@
length = snprintf(buf, buf_len, "Unknown error %d", error_number);
}
if (length >= buf_len) {
- errno_restorer.override(ERANGE);
+ errno = ERANGE;
return -1;
}
+ errno = saved_errno;
return 0;
}