preload-hacks: Some patches to make it work.
[termux-packages] / packages / preload-hacks / sun-len.patch
CommitLineData
99494f82
MW
1diff --git a/noip.c b/noip.c
2index aca7b75..479bdf5 100644
3--- a/noip.c
4+++ b/noip.c
5@@ -57,6 +57,11 @@
6 #include <ifaddrs.h>
7 #include <netdb.h>
8
9+#ifndef SUN_LEN
10+# define SUN_LEN(sun) \
11+ (strlen((sun)->sun_path) + offsetof(struct sockaddr_un, sun_path))
12+#endif
13+
14 /*----- Data structures ---------------------------------------------------*/
15
16 /* Unix socket status values. */
17diff --git a/uopen.c b/uopen.c
18index 3c0d1d4..22b09db 100644
19--- a/uopen.c
20+++ b/uopen.c
21@@ -42,6 +42,11 @@
22 #include <sys/stat.h>
23 #include <sys/un.h>
24
25+#ifndef SUN_LEN
26+# define SUN_LEN(sun) \
27+ (strlen((sun)->sun_path) + offsetof(struct sockaddr_un, sun_path))
28+#endif
29+
30 /*----- Import the real versions of functions -----------------------------*/
31
32 /* The list of functions to immport. */