Files
haikuports/net-libs/libwebsockets/patches/libwebsockets-4.3.3.patchset
PulkoMandy b4dfc1bc7d libwebsockets: update to 4.3.3
Part of the openssl3 migration efforts
2024-08-28 20:59:29 +02:00

82 lines
2.7 KiB
Plaintext

From a1fe8de330859946f6bac5987bab3254df3edea2 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Wed, 28 Aug 2024 20:58:09 +0200
Subject: Disable some linux-isms for Haiku
- We don't have IPTOS_MINCOST
- We don't have stat information in dirents
- Our ioctl use an unsigned long instead of an int
diff --git a/lib/misc/dir.c b/lib/misc/dir.c
index b343b92..d703f19 100644
--- a/lib/misc/dir.c
+++ b/lib/misc/dir.c
@@ -131,7 +131,7 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb)
}
for (i = 0; i < n; i++) {
-#if !defined(__sun) && !defined(__QNX__)
+#if !defined(__sun) && !defined(__QNX__) && !defined(__HAIKU__)
unsigned int type = namelist[i]->d_type;
#endif
if (strchr(namelist[i]->d_name, '~'))
@@ -143,7 +143,7 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb)
* files are LDOT_UNKNOWN
*/
-#if defined(__sun) || defined(__QNX__)
+#if defined(__sun) || defined(__QNX__) || defined(__HAIKU__)
lws_dir_via_stat(combo, l, namelist[i]->d_name, &lde);
#else
/*
diff --git a/lib/misc/getifaddrs.c b/lib/misc/getifaddrs.c
index 125088e..c8f6a94 100644
--- a/lib/misc/getifaddrs.c
+++ b/lib/misc/getifaddrs.c
@@ -100,7 +100,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
/*
* Solaris returns EINVAL when the buffer is too small.
*/
- if (ioctl(fd, siocgifconf, &ifconf) < 0 && errno != EINVAL) {
+ if (ioctl(fd, (ulong)siocgifconf, &ifconf) < 0 && errno != EINVAL) {
ret = errno;
goto error_out;
}
@@ -115,7 +115,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
buf_size *= 2;
}
- for (p = ifconf.ifc_buf; p < ifconf.ifc_buf + ifconf.ifc_len; p += sz) {
+ for (p = ifconf.ifc_buf; p < (char*)ifconf.ifc_buf + ifconf.ifc_len; p += sz) {
struct ifreq ifreq;
struct sockaddr *sa;
size_t salen;
@@ -136,7 +136,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
memset(&ifreq, 0, sizeof(ifreq));
memcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name));
- if (ioctl(fd, siocgifflags, &ifreq) < 0) {
+ if (ioctl(fd, (ulong)siocgifflags, &ifreq) < 0) {
ret = errno;
goto error_out;
}
diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c
index cb2f1bb..8e91d9c 100644
--- a/lib/plat/unix/unix-sockets.c
+++ b/lib/plat/unix/unix-sockets.c
@@ -198,8 +198,10 @@ static const int ip_opt_lws_flags[] = {
#endif
}, ip_opt_val[] = {
IPTOS_LOWDELAY, IPTOS_THROUGHPUT, IPTOS_RELIABILITY
-#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__)
+#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__) && !defined(__HAIKU__)
, IPTOS_MINCOST
+#else
+ , 0
#endif
};
#if !defined(LWS_WITH_NO_LOGS)
--
2.45.2