powertop: add package

package for monitoring power consumption
001 and 002 patches are taken from Alpine Linux

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
This commit is contained in:
Lucian Cristian
2019-02-15 21:24:44 +02:00
parent 0745dc5d6c
commit 3f36168651
5 changed files with 156 additions and 0 deletions
@@ -0,0 +1,20 @@
--- traceevent/event-parse.c.orig
+++ ./traceevent/event-parse.c
@@ -5121,12 +5121,17 @@
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;
}