Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/modules/temperature Modified Files: e_mod_main.c Log Message: bsd temp patch =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- e_mod_main.c 25 May 2005 08:08:44 -0000 1.28 +++ e_mod_main.c 23 Jun 2005 02:49:32 -0000 1.29 @@ -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 @@ 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 @@ } } if (therms) ecore_list_destroy(therms); +#endif if (ret) { if (ef->have_temp != 1) ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs