summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Poole <netstar@gmail.com>2016-11-28 10:43:07 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-11-28 10:59:50 -0500
commit617ef1887edbca9dadd248499442b7ab7347500e (patch)
treea2bc191f44e164c8a110bac3220cfcf8972b9689
parent157ab706736389cef1c8b127aac6f61309664286 (diff)
Add temperature support for DragonFly BSD.
Reviewers: zmike! Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D4432
-rw-r--r--src/modules/temperature/e_mod_main.c2
-rw-r--r--src/modules/temperature/tempget.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c
index b6a521f17..345b7e6ca 100644
--- a/src/modules/temperature/e_mod_main.c
+++ b/src/modules/temperature/e_mod_main.c
@@ -1,7 +1,7 @@
1#include "e.h" 1#include "e.h"
2#include "e_mod_main.h" 2#include "e_mod_main.h"
3 3
4#ifdef __FreeBSD__ 4#if defined(__FreeBSD__) || defined(__DragonFly__)
5#include <sys/types.h> 5#include <sys/types.h>
6#include <sys/sysctl.h> 6#include <sys/sysctl.h>
7#endif 7#endif
diff --git a/src/modules/temperature/tempget.c b/src/modules/temperature/tempget.c
index f66f0292c..c5153b7c9 100644
--- a/src/modules/temperature/tempget.c
+++ b/src/modules/temperature/tempget.c
@@ -1,6 +1,6 @@
1#include "e.h" 1#include "e.h"
2 2
3#ifdef __FreeBSD__ 3#if defined (__FreeBSD__) || defined(__DragonFly__)
4# include <sys/types.h> 4# include <sys/types.h>
5# include <sys/sysctl.h> 5# include <sys/sysctl.h>
6# include <errno.h> 6# include <errno.h>
@@ -22,10 +22,10 @@ static int poll_interval = 32;
22static int cur_poll_interval = 32; 22static int cur_poll_interval = 32;
23 23
24static char *sensor_path = NULL; 24static char *sensor_path = NULL;
25#if defined (__FreeBSD__) || defined (__OpenBSD__) 25#if defined (__FreeBSD__) || defined(__DragonFly__) || defined (__OpenBSD__)
26static int mib[CTL_MAXNAME]; 26static int mib[CTL_MAXNAME];
27#endif 27#endif
28#ifdef __FreeBSD__ 28#if defined (__FreeBSD__) || defined(__DragonFly__)
29static unsigned miblen; 29static unsigned miblen;
30static const char *sources[] = 30static const char *sources[] =
31 { 31 {
@@ -100,7 +100,7 @@ init(void)
100{ 100{
101 Eina_List *therms; 101 Eina_List *therms;
102 char path[PATH_MAX]; 102 char path[PATH_MAX];
103#ifdef __FreeBSD__ 103#if defined (__FreeBSD__) || defined(__DragonFly__)
104 unsigned i; 104 unsigned i;
105 size_t len; 105 size_t len;
106 int rc; 106 int rc;
@@ -110,7 +110,7 @@ init(void)
110 { 110 {
111 E_FREE(sensor_name); 111 E_FREE(sensor_name);
112 E_FREE(sensor_path); 112 E_FREE(sensor_path);
113#ifdef __FreeBSD__ 113#if defined (__FreeBSD__) || defined(__DragonFly__)
114 for (i = 0; sources[i]; i++) 114 for (i = 0; sources[i]; i++)
115 { 115 {
116 rc = sysctlbyname(sources[i], NULL, NULL, NULL, 0); 116 rc = sysctlbyname(sources[i], NULL, NULL, NULL, 0);
@@ -284,7 +284,7 @@ init(void)
284 break; 284 break;
285 285
286 case SENSOR_TYPE_FREEBSD: 286 case SENSOR_TYPE_FREEBSD:
287#ifdef __FreeBSD__ 287#if defined (__FreeBSD__) || defined(__DragonFly__)
288 len = sizeof(mib) / sizeof(mib[0]); 288 len = sizeof(mib) / sizeof(mib[0]);
289 rc = sysctlnametomib(sensor_name, mib, &len); 289 rc = sysctlnametomib(sensor_name, mib, &len);
290 if (rc == 0) 290 if (rc == 0)
@@ -394,7 +394,7 @@ check(void)
394 int ret = 0; 394 int ret = 0;
395 int temp = 0; 395 int temp = 0;
396 char buf[4096]; 396 char buf[4096];
397#ifdef __FreeBSD__ 397#if defined (__FreeBSD__) || defined(__DragonFly__)
398 size_t len; 398 size_t len;
399 size_t ftemp = 0; 399 size_t ftemp = 0;
400#endif 400#endif
@@ -410,7 +410,7 @@ check(void)
410 break; 410 break;
411 411
412 case SENSOR_TYPE_FREEBSD: 412 case SENSOR_TYPE_FREEBSD:
413#ifdef __FreeBSD__ 413#if defined (__FreeBSD__) || defined(__DragonFly__)
414 len = sizeof(ftemp); 414 len = sizeof(ftemp);
415 if (sysctl(mib, miblen, &ftemp, &len, NULL, 0) == 0) 415 if (sysctl(mib, miblen, &ftemp, &len, NULL, 0) == 0)
416 { 416 {