diff --git a/src/ppd-driver-intel-pstate.c b/src/ppd-driver-intel-pstate.c index d5f0bf3..4f104af 100644 --- a/src/ppd-driver-intel-pstate.c +++ b/src/ppd-driver-intel-pstate.c @@ -80,6 +80,7 @@ update_no_turbo (PpdDriverIntelPstate *pstate) gboolean turbo_disabled = FALSE; if (g_file_get_contents (pstate->no_turbo_path, &contents, NULL, NULL)) { + contents = g_strchomp (contents); if (g_strcmp0 (contents, "1") == 0) turbo_disabled = TRUE; } diff --git a/tests/integration-test b/tests/integration-test index e8702c5..4ff8ab2 100755 --- a/tests/integration-test +++ b/tests/integration-test @@ -317,7 +317,7 @@ class Tests(dbusmock.DBusTestCase): pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") os.makedirs(pstate_dir) with open(os.path.join(pstate_dir, "no_turbo") ,'w') as no_turbo: - no_turbo.write("0") + no_turbo.write("0\n") self.start_daemon() @@ -342,7 +342,7 @@ class Tests(dbusmock.DBusTestCase): # Disable turbo with open(os.path.join(pstate_dir, "no_turbo") ,'w') as no_turbo: - no_turbo.write("1") + no_turbo.write("1\n") self.assertEventually(lambda: self.have_text_in_log('File monitor change happened for ')) self.assertEqual(self.get_dbus_property('ActiveProfile'), 'balanced')