void-packages/srcpkgs/powertop/patches/powertop-2.0-always-create-params.patch

34 lines
1 KiB
Diff

--- src/parameters/persistent.cpp.orig 2012-05-04 18:03:54.000000000 +0200
+++ src/parameters/persistent.cpp 2012-05-16 21:29:24.785390730 +0200
@@ -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();
}