File powertop-1.98-always-create-params.patch of Package powertop

---
 src/parameters/persistent.cpp |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: powertop-2.0/src/parameters/persistent.cpp
===================================================================
--- powertop-2.0.orig/src/parameters/persistent.cpp
+++ powertop-2.0/src/parameters/persistent.cpp
@@ -129,9 +129,6 @@ void save_parameters(const char *filenam
 
 //	printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size());
 
-	if (!global_power_valid())
-		return;
-
 	pathname = get_param_directory(filename);
 
 	file.open(pathname, ios::out);
@@ -140,12 +137,15 @@ void save_parameters(const char *filenam
 		return;
 	}
 
-	map<string, int>::iterator it;
-
-	for (it = param_index.begin(); it != param_index.end(); it++) {
-		int index;
-		index = it->second;
-		file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
+	if (global_power_valid())
+	{
+		map<string, int>::iterator it;
+
+		for (it = param_index.begin(); it != param_index.end(); it++) {
+			int index;
+			index = it->second;
+			file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
+		}
 	}
 	file.close();
 }