diff options
author | Alastair Poole <netstar@gmail.com> | 2021-04-10 08:58:38 +0100 |
---|---|---|
committer | Alastair Poole <netstar@gmail.com> | 2021-04-10 08:58:38 +0100 |
commit | b02cef69d11bcb5b2b8acdf881324959a1756d14 (patch) | |
tree | 0b818d40836079e400af5234abfbe42e8c4db8b7 | |
parent | 77a3b908eda7323892b6c2b824a2ce638645b230 (diff) | |
download | efl-b02cef69d11bcb5b2b8acdf881324959a1756d14.tar.gz |
freebsd: eeze support if enabled.
ifr_netmask is not available on FreeBSD. On Linux ifr_addr is
same union.
Peter2121 did this work.
-rwxr-xr-x | confs/freebsd.sh | 2 | ||||
-rw-r--r-- | src/lib/ecore_input/ecore_input_joystick.c | 2 | ||||
-rw-r--r-- | src/lib/eeze/eeze_net.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/confs/freebsd.sh b/confs/freebsd.sh index ac41281bcc..198e6ebf0a 100755 --- a/confs/freebsd.sh +++ b/confs/freebsd.sh @@ -1,3 +1,3 @@ #!/bin/sh -e -meson -Dsystemd=false -Dv4l2=false -Deeze=false \ +meson -Dsystemd=false -Dv4l2=false -Deeze=false -Dinput=false \ $@ . build 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 @@ #endif /*FIXME: change OS specific value */ -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) # include <linux/joystick.h> #endif 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 @@ #include <arpa/inet.h> #include <sys/ioctl.h> #include <net/if.h> +#include <netinet/in.h> #include <unistd.h> #include <Eeze_Net.h> @@ -203,7 +204,7 @@ eeze_net_scan(Eeze_Net *net) eina_stringshare_replace_length(&net->broadip, ip, INET_ADDRSTRLEN); if (ioctl(sock, *i++, &ifr) < 0) goto error; - sa = (struct sockaddr_in*) & (ifr.ifr_netmask); + sa = (struct sockaddr_in*) & (ifr.ifr_addr); inet_ntop(AF_INET, (struct in_addr*)&sa->sin_addr, ip, INET_ADDRSTRLEN); eina_stringshare_replace_length(&net->netmask, ip, INET_ADDRSTRLEN); @@ -225,7 +226,7 @@ eeze_net_scan(Eeze_Net *net) eina_stringshare_replace_length(&net->broadip6, ip6, INET6_ADDRSTRLEN); if (ioctl(sock, *i++, &ifr) < 0) goto error; - sa6 = (struct sockaddr_in6*) & (ifr.ifr_netmask); + sa6 = (struct sockaddr_in6*) & (ifr.ifr_addr); inet_ntop(AF_INET6, (struct in6_addr*)&sa6->sin6_addr, ip6, INET6_ADDRSTRLEN); eina_stringshare_replace_length(&net->netmask6, ip6, INET6_ADDRSTRLEN); |