summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2021-04-10 08:58:38 +0100
committerAlastair Poole <netstar@gmail.com>2021-04-10 08:58:38 +0100
commitb02cef69d11bcb5b2b8acdf881324959a1756d14 (patch)
tree0b818d40836079e400af5234abfbe42e8c4db8b7 /src
parent77a3b908eda7323892b6c2b824a2ce638645b230 (diff)
freebsd: eeze support if enabled.
ifr_netmask is not available on FreeBSD. On Linux ifr_addr is same union. Peter2121 did this work.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_input/ecore_input_joystick.c2
-rw-r--r--src/lib/eeze/eeze_net.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/ecore_input/ecore_input_joystick.c b/src/lib/ecore_input/ecore_input_joystick.c
index 7793c3bf35..f25b4ee67e 100644
--- a/src/lib/ecore_input/ecore_input_joystick.c
+++ b/src/lib/ecore_input/ecore_input_joystick.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4 4
5/*FIXME: change OS specific value */ 5/*FIXME: change OS specific value */
6#ifdef __linux__ 6#if defined(__linux__) || defined(__FreeBSD__)
7# include <linux/joystick.h> 7# include <linux/joystick.h>
8#endif 8#endif
9 9
diff --git a/src/lib/eeze/eeze_net.c b/src/lib/eeze/eeze_net.c
index bdd7181993..11fcc26d46 100644
--- a/src/lib/eeze/eeze_net.c
+++ b/src/lib/eeze/eeze_net.c
@@ -5,6 +5,7 @@
5#include <arpa/inet.h> 5#include <arpa/inet.h>
6#include <sys/ioctl.h> 6#include <sys/ioctl.h>
7#include <net/if.h> 7#include <net/if.h>
8#include <netinet/in.h>
8#include <unistd.h> 9#include <unistd.h>
9#include <Eeze_Net.h> 10#include <Eeze_Net.h>
10 11
@@ -203,7 +204,7 @@ eeze_net_scan(Eeze_Net *net)
203 eina_stringshare_replace_length(&net->broadip, ip, INET_ADDRSTRLEN); 204 eina_stringshare_replace_length(&net->broadip, ip, INET_ADDRSTRLEN);
204 205
205 if (ioctl(sock, *i++, &ifr) < 0) goto error; 206 if (ioctl(sock, *i++, &ifr) < 0) goto error;
206 sa = (struct sockaddr_in*) & (ifr.ifr_netmask); 207 sa = (struct sockaddr_in*) & (ifr.ifr_addr);
207 inet_ntop(AF_INET, (struct in_addr*)&sa->sin_addr, ip, INET_ADDRSTRLEN); 208 inet_ntop(AF_INET, (struct in_addr*)&sa->sin_addr, ip, INET_ADDRSTRLEN);
208 eina_stringshare_replace_length(&net->netmask, ip, INET_ADDRSTRLEN); 209 eina_stringshare_replace_length(&net->netmask, ip, INET_ADDRSTRLEN);
209 210
@@ -225,7 +226,7 @@ eeze_net_scan(Eeze_Net *net)
225 eina_stringshare_replace_length(&net->broadip6, ip6, INET6_ADDRSTRLEN); 226 eina_stringshare_replace_length(&net->broadip6, ip6, INET6_ADDRSTRLEN);
226 227
227 if (ioctl(sock, *i++, &ifr) < 0) goto error; 228 if (ioctl(sock, *i++, &ifr) < 0) goto error;
228 sa6 = (struct sockaddr_in6*) & (ifr.ifr_netmask); 229 sa6 = (struct sockaddr_in6*) & (ifr.ifr_addr);
229 inet_ntop(AF_INET6, (struct in6_addr*)&sa6->sin6_addr, ip6, INET6_ADDRSTRLEN); 230 inet_ntop(AF_INET6, (struct in6_addr*)&sa6->sin6_addr, ip6, INET6_ADDRSTRLEN);
230 eina_stringshare_replace_length(&net->netmask6, ip6, INET6_ADDRSTRLEN); 231 eina_stringshare_replace_length(&net->netmask6, ip6, INET6_ADDRSTRLEN);
231 232