Blame SOURCES/powertop-2.7-always-create-params.patch

294623
diff --git a/src/parameters/persistent.cpp b/src/parameters/persistent.cpp
294623
index 9a5688a..6a232cd 100644
294623
--- a/src/parameters/persistent.cpp
294623
+++ b/src/parameters/persistent.cpp
294623
@@ -145,9 +145,6 @@ void save_parameters(const char *filename)
294623
 
294623
 //	printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size());
294623
 
294623
-	if (!global_power_valid())
294623
-		return;
294623
-
294623
 	pathname = get_param_directory(filename);
294623
 
294623
 	file.open(pathname, ios::out);
294623
@@ -156,12 +153,15 @@ void save_parameters(const char *filename)
294623
 		return;
294623
 	}
294623
 
294623
-	map<string, int>::iterator it;
294623
+	if (global_power_valid())
294623
+	{
294623
+		map<string, int>::iterator it;
294623
 
294623
-	for (it = param_index.begin(); it != param_index.end(); it++) {
294623
-		int index;
294623
-		index = it->second;
294623
-		file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
294623
+		for (it = param_index.begin(); it != param_index.end(); it++) {
294623
+			int index;
294623
+			index = it->second;
294623
+			file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
294623
+		}
294623
 	}
294623
 	file.close();
294623
 }