netstar pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b02cef69d11bcb5b2b8acdf881324959a1756d14

commit b02cef69d11bcb5b2b8acdf881324959a1756d14
Author: Alastair Poole <nets...@gmail.com>
Date:   Sat Apr 10 08:58:38 2021 +0100

    freebsd: eeze support if enabled.
    
    ifr_netmask is not available on FreeBSD. On Linux ifr_addr is
    same union.
    
    Peter2121 did this work.
---
 confs/freebsd.sh                           | 2 +-
 src/lib/ecore_input/ecore_input_joystick.c | 2 +-
 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);
 

-- 


Reply via email to