]>
Commit | Line | Data |
---|---|---|
d07674cb MT |
1 | diff -up powertop-1.98/parameters/persistent.cpp.orig powertop-1.98/parameters/persistent.cpp |
2 | --- powertop-1.98/parameters/persistent.cpp.orig 2011-05-11 06:48:37.000000000 +0200 | |
3 | +++ powertop-1.98/parameters/persistent.cpp 2011-12-02 19:48:45.056747667 +0100 | |
4 | @@ -122,22 +122,23 @@ void save_parameters(const char *filenam | |
5 | ||
6 | // printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size()); | |
7 | ||
8 | - if (!global_power_valid()) | |
9 | - return; | |
10 | ||
11 | file.open(filename, ios::out); | |
12 | if (!file) { | |
13 | cout << _("Cannot save to file ") << filename << "\n"; | |
14 | return; | |
15 | } | |
16 | - | |
17 | - map<string, int>::iterator it; | |
18 | ||
19 | - for (it = param_index.begin(); it != param_index.end(); it++) { | |
20 | - int index; | |
21 | - index = it->second; | |
22 | - file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n"; | |
23 | - } | |
24 | + if (global_power_valid()) | |
25 | + { | |
26 | + map<string, int>::iterator it; | |
27 | + | |
28 | + for (it = param_index.begin(); it != param_index.end(); it++) { | |
29 | + int index; | |
30 | + index = it->second; | |
31 | + file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n"; | |
32 | + } | |
33 | + } | |
34 | file.close(); | |
35 | } | |
36 |