From: Mark Wooding Date: Tue, 12 Jun 2018 11:07:34 +0000 (+0100) Subject: noip.c, uopen.c: Provide fallback implementation of `SUN_LEN'. X-Git-Tag: 1.2.3~3 X-Git-Url: https://git.distorted.org.uk/~mdw/preload-hacks/commitdiff_plain/3fa609318c4e7ad8c53bb80a605567eabbc637dc?hp=3cefd57ae9e27dba0956368fd125b9786534407f noip.c, uopen.c: Provide fallback implementation of `SUN_LEN'. Apparently Android's `libc' doesn't have this. --- diff --git a/noip.c b/noip.c index aca7b75..b9c040b 100644 --- a/noip.c +++ b/noip.c @@ -57,6 +57,11 @@ #include #include +#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 #include +#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. */