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

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