ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/utils/powertop/patches/002-strerror_r.patch b/external/subpack/utils/powertop/patches/002-strerror_r.patch
new file mode 100644
index 0000000..7612a85
--- /dev/null
+++ b/external/subpack/utils/powertop/patches/002-strerror_r.patch
@@ -0,0 +1,20 @@
+--- a/traceevent/event-parse.c
++++ b/traceevent/event-parse.c
+@@ -5121,12 +5121,17 @@ int pevent_strerror(struct pevent *peven
+ const char *msg;
+
+ if (errnum >= 0) {
++#if defined(__GLIBC__)
+ msg = strerror_r(errnum, buf, buflen);
+ if (msg != buf) {
+ size_t len = strlen(msg);
+ memcpy(buf, msg, min(buflen - 1, len));
+ *(buf + min(buflen - 1, len)) = '\0';
+ }
++#else
++ if (strerror_r(errnum, buf, buflen))
++ snprintf(buf, buflen, "errnum %i", errnum);
++#endif
+ return 0;
+ }
+