aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/temperature/e_mod_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-06-23 02:49:32 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-06-23 02:49:32 +0000
commitae6595f0b14e35c400c152c4bf7df4b29c28ea3c (patch)
treee5d182fbbc0467fe3c6f96d47d2c1d73676d3362 /src/modules/temperature/e_mod_main.c
parentupdate (diff)
downloadenlightenment-ae6595f0b14e35c400c152c4bf7df4b29c28ea3c.tar.gz
bsd temp patch
SVN revision: 15499
Diffstat (limited to 'src/modules/temperature/e_mod_main.c')
-rw-r--r--src/modules/temperature/e_mod_main.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c
index 55ce9b43f..48d3736c5 100644
--- a/src/modules/temperature/e_mod_main.c
+++ b/src/modules/temperature/e_mod_main.c
@@ -4,6 +4,11 @@
#include "e.h"
#include "e_mod_main.h"
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
/* TODO List:
*
* which options should be in main menu, and which in face menu?
@@ -780,8 +785,28 @@ _temperature_cb_check(void *data)
Evas_List *l;
int temp = 0;
char buf[4096];
-
+#ifdef __FreeBSD__
+ static int mib[5] = {-1};
+ int len;
+#endif
ef = data;
+#ifdef __FreeBSD__
+ if (mib[0] == -1)
+ {
+ len = 5;
+ sysctlnametomib("hw.acpi.thermal.tz0.temperature", mib, &len);
+ }
+
+ if (mib[0] != -1)
+ {
+ len = sizeof(temp);
+ if (sysctl(mib, 5, &temp, &len, NULL, 0) != -1)
+ {
+ temp = (temp - 2732) / 10;
+ ret = 1;
+ }
+ }
+#else
therms = ecore_file_ls("/proc/acpi/thermal_zone");
if (!therms || ecore_list_is_empty(therms))
{
@@ -852,6 +877,7 @@ _temperature_cb_check(void *data)
}
}
if (therms) ecore_list_destroy(therms);
+#endif
if (ret)
{
if (ef->have_temp != 1)