preload-hacks: Some patches to make it work.
[termux-packages] / packages / preload-hacks / sun-len.patch
diff --git a/packages/preload-hacks/sun-len.patch b/packages/preload-hacks/sun-len.patch
new file mode 100644 (file)
index 0000000..143dabe
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/noip.c b/noip.c
+index aca7b75..479bdf5 100644
+--- a/noip.c
++++ b/noip.c
+@@ -57,6 +57,11 @@
+ #include <ifaddrs.h>
+ #include <netdb.h>
++#ifndef SUN_LEN
++#  define SUN_LEN(sun) \
++      (strlen((sun)->sun_path) + offsetof(struct sockaddr_un, sun_path))
++#endif
++
+ /*----- Data structures ---------------------------------------------------*/
+ /* Unix socket status values. */
+diff --git a/uopen.c b/uopen.c
+index 3c0d1d4..22b09db 100644
+--- a/uopen.c
++++ b/uopen.c
+@@ -42,6 +42,11 @@
+ #include <sys/stat.h>
+ #include <sys/un.h>
++#ifndef SUN_LEN
++#  define SUN_LEN(sun) \
++      (strlen((sun)->sun_path) + offsetof(struct sockaddr_un, sun_path))
++#endif
++
+ /*----- Import the real versions of functions -----------------------------*/
+ /* The list of functions to immport. */