Lines 219-225
Link Here
|
219 |
cpufreq_utils_display_error (const gchar *message, |
219 |
cpufreq_utils_display_error (const gchar *message, |
220 |
--- cpufreq/src/cpufreq-monitor-sysctl.c.orig Wed Feb 28 14:03:58 2007 |
220 |
--- cpufreq/src/cpufreq-monitor-sysctl.c.orig Wed Feb 28 14:03:58 2007 |
221 |
+++ cpufreq/src/cpufreq-monitor-sysctl.c Wed Feb 28 14:28:47 2007 |
221 |
+++ cpufreq/src/cpufreq-monitor-sysctl.c Wed Feb 28 14:28:47 2007 |
222 |
@@ -0,0 +1,176 @@ |
222 |
@@ -0,0 +1,185 @@ |
223 |
+/* |
223 |
+/* |
224 |
+ * Copyright (C) 2001, 2002 Free Software Foundation |
224 |
+ * Copyright (C) 2001, 2002 Free Software Foundation |
225 |
+ * |
225 |
+ * |
Lines 305-310
Link Here
|
305 |
+ fmax = atoi ((gchar *) list->data); |
305 |
+ fmax = atoi ((gchar *) list->data); |
306 |
+ fmin = atoi ((gchar *) g_list_nth_data (list, (g_list_length (list) - 1))); |
306 |
+ fmin = atoi ((gchar *) g_list_nth_data (list, (g_list_length (list) - 1))); |
307 |
+ |
307 |
+ |
|
|
308 |
+ g_list_foreach (list, (GFunc) g_free, NULL); |
309 |
+ g_list_free (list); |
310 |
+ |
308 |
+ g_object_get (G_OBJECT (monitor), "cpu", &mon_cpu, NULL); |
311 |
+ g_object_get (G_OBJECT (monitor), "cpu", &mon_cpu, NULL); |
309 |
+ len = sizeof (ifreq); |
312 |
+ len = sizeof (ifreq); |
310 |
+ freq_oid = g_strdup_printf ("dev.cpu.%d.freq", 0); |
313 |
+ freq_oid = g_strdup_printf ("dev.cpu.%d.freq", 0); |
Lines 314-319
Link Here
|
314 |
+ return FALSE; |
317 |
+ return FALSE; |
315 |
+ } |
318 |
+ } |
316 |
+ |
319 |
+ |
|
|
320 |
+ g_free (freq_oid); |
321 |
+ |
317 |
+ ifreq *= 1000; |
322 |
+ ifreq *= 1000; |
318 |
+ |
323 |
+ |
319 |
+ if (ifreq == fmax) |
324 |
+ if (ifreq == fmax) |
Lines 330-335
Link Here
|
330 |
+ "max-frequency", fmax, |
335 |
+ "max-frequency", fmax, |
331 |
+ NULL); |
336 |
+ NULL); |
332 |
+ |
337 |
+ |
|
|
338 |
+ g_free (governor); |
339 |
+ |
333 |
+ return TRUE; |
340 |
+ return TRUE; |
334 |
+} |
341 |
+} |
335 |
+ |
342 |
+ |
Lines 356-363
Link Here
|
356 |
+ return NULL; |
363 |
+ return NULL; |
357 |
+ |
364 |
+ |
358 |
+ levels = g_malloc (len); |
365 |
+ levels = g_malloc (len); |
359 |
+ if (sysctl (mib, 4, levels, &len, NULL, 0) == -1) |
366 |
+ if (sysctl (mib, 4, levels, &len, NULL, 0) == -1) { |
|
|
367 |
+ g_free (levels); |
360 |
+ return NULL; |
368 |
+ return NULL; |
|
|
369 |
+ } |
361 |
+ |
370 |
+ |
362 |
+ levelsp = g_strsplit (levels, " ", 0); |
371 |
+ levelsp = g_strsplit (levels, " ", 0); |
363 |
+ g_free (levels); |
372 |
+ g_free (levels); |