patch-utils_set_c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. --- cpufrequtils-007.orig/utils/set.c 2010-01-16 14:47:44.000000000 +0100
  2. +++ cpufrequtils-007/utils/set.c 2010-01-23 18:51:50.185869113 +0100
  3. @@ -12,9 +12,6 @@
  4. #include <limits.h>
  5. #include <string.h>
  6. #include <ctype.h>
  7. -#include <libintl.h>
  8. -#include <locale.h>
  9. -
  10. #include <getopt.h>
  11. #include "cpufreq.h"
  12. @@ -28,29 +25,29 @@
  13. static void print_header(void)
  14. {
  15. printf(PACKAGE " " VERSION ": cpufreq-set (C) Dominik Brodowski 2004-2009\n");
  16. - printf(gettext("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT);
  17. + printf("Report errors and bugs to %s, please.\n", PACKAGE_BUGREPORT);
  18. }
  19. static void print_help(void)
  20. {
  21. - printf(gettext("Usage: cpufreq-set [options]\n"));
  22. - printf(gettext("Options:\n"));
  23. - printf(gettext(" -c CPU, --cpu CPU number of CPU where cpufreq settings shall be modified\n"));
  24. - printf(gettext(" -d FREQ, --min FREQ new minimum CPU frequency the governor may select\n"));
  25. - printf(gettext(" -u FREQ, --max FREQ new maximum CPU frequency the governor may select\n"));
  26. - printf(gettext(" -g GOV, --governor GOV new cpufreq governor\n"));
  27. - printf(gettext(" -f FREQ, --freq FREQ specific frequency to be set. Requires userspace\n"
  28. - " governor to be available and loaded\n"));
  29. - printf(gettext(" -r, --related Switches all hardware-related CPUs\n"));
  30. - printf(gettext(" -h, --help Prints out this screen\n"));
  31. + printf("Usage: cpufreq-set [options]\n");
  32. + printf("Options:\n");
  33. + printf(" -c CPU, --cpu CPU number of CPU where cpufreq settings shall be modified\n");
  34. + printf(" -d FREQ, --min FREQ new minimum CPU frequency the governor may select\n");
  35. + printf(" -u FREQ, --max FREQ new maximum CPU frequency the governor may select\n");
  36. + printf(" -g GOV, --governor GOV new cpufreq governor\n");
  37. + printf(" -f FREQ, --freq FREQ specific frequency to be set. Requires userspace\n"
  38. + " governor to be available and loaded\n");
  39. + printf(" -r, --related Switches all hardware-related CPUs\n");
  40. + printf(" -h, --help Prints out this screen\n");
  41. printf("\n");
  42. - printf(gettext("Notes:\n"
  43. + printf("Notes:\n"
  44. "1. Omitting the -c or --cpu argument is equivalent to setting it to zero\n"
  45. "2. The -f FREQ, --freq FREQ parameter cannot be combined with any other parameter\n"
  46. " except the -c CPU, --cpu CPU parameter\n"
  47. "3. FREQuencies can be passed in Hz, kHz (default), MHz, GHz, or THz\n"
  48. " by postfixing the value with the wanted unit name, without any space\n"
  49. - " (FREQuency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).\n"));
  50. + " (FREQuency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).\n");
  51. }
  52. @@ -66,13 +63,13 @@ static struct option set_opts[] = {
  53. static void print_error(void)
  54. {
  55. - printf(gettext("Error setting new values. Common errors:\n"
  56. + printf("Error setting new values. Common errors:\n"
  57. "- Do you have proper administration rights? (super-user?)\n"
  58. "- Is the governor you requested available and modprobed?\n"
  59. "- Trying to set an invalid policy?\n"
  60. "- Trying to set a specific frequency, but userspace governor is not available,\n"
  61. " for example because of hardware which cannot be set to a specific frequency\n"
  62. - " or because the userspace governor isn't loaded?\n"));
  63. + " or because the userspace governor isn't loaded?\n");
  64. };
  65. struct freq_units {
  66. @@ -92,7 +89,7 @@ const struct freq_units def_units[] = {
  67. static void print_unknown_arg(void)
  68. {
  69. print_header();
  70. - printf(gettext("invalid or unknown argument\n"));
  71. + printf("invalid or unknown argument\n");
  72. print_help();
  73. }
  74. @@ -180,7 +177,7 @@ static int do_new_policy(unsigned int cp
  75. int ret;
  76. if (!cur_pol) {
  77. - printf(gettext("wrong, unknown or unhandled CPU?\n"));
  78. + printf("wrong, unknown or unhandled CPU?\n");
  79. return -EINVAL;
  80. }
  81. @@ -248,9 +245,6 @@ int main(int argc, char **argv)
  82. };
  83. struct cpufreq_affected_cpus *cpus = NULL;
  84. - setlocale(LC_ALL, "");
  85. - textdomain (PACKAGE);
  86. -
  87. /* parameter parsing */
  88. do {
  89. ret = getopt_long(argc, argv, "c:d:u:g:f:hr", set_opts, NULL);
  90. @@ -333,14 +327,14 @@ int main(int argc, char **argv)
  91. }
  92. if (freq && policychange) {
  93. - printf(gettext("the -f/--freq parameter cannot be combined with -d/--min, -u/--max or\n"
  94. - "-g/--governor parameters\n"));
  95. + printf("the -f/--freq parameter cannot be combined with -d/--min, -u/--max or\n"
  96. + "-g/--governor parameters\n");
  97. return -EINVAL;
  98. }
  99. if (!freq && !policychange) {
  100. - printf(gettext("At least one parameter out of -f/--freq, -d/--min, -u/--max, and\n"
  101. - "-g/--governor must be passed\n"));
  102. + printf("At least one parameter out of -f/--freq, -d/--min, -u/--max, and\n"
  103. + "-g/--governor must be passed\n");
  104. return -EINVAL;
  105. }