aboutsummaryrefslogtreecommitdiff
path: root/utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch
diff options
context:
space:
mode:
Diffstat (limited to 'utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch')
-rw-r--r--utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch b/utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch
new file mode 100644
index 000000000..46d01703f
--- /dev/null
+++ b/utils/powertop/patches/020-intel_cpus.cpp-Change-open-parameter-to-const-char.patch
@@ -0,0 +1,30 @@
+From 8cdf846922ffb3e0d2a828be473fdf9c45a56e7c Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Sat, 30 Mar 2019 20:19:17 -0700
+Subject: [PATCH] intel_cpus.cpp: Change open parameter to const char *
+
+ifstream::open takes std::string starting with C++11, not before.
+
+This fixes compilation with uClibc++ and potentially other older libraries
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ src/cpu/intel_cpus.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
+index 0030dba..4dffadc 100644
+--- a/src/cpu/intel_cpus.cpp
++++ b/src/cpu/intel_cpus.cpp
+@@ -92,7 +92,7 @@ int is_supported_intel_cpu(int model, int cpu)
+
+ int is_intel_pstate_driver_loaded()
+ {
+- const string filename("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver");
++ const char *filename = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver";
+ const string intel_pstate("intel_pstate");
+ char line[32] = { '\0' };
+ ifstream file;
+--
+2.17.1
+