Re: [systemd-devel] [RFC 09/25] shared/socket-util: don't fail if libc doesn't support IDN

2014-10-09 Thread Lennart Poettering
On Thu, 18.09.14 15:24, Emil Renner Berthing (syst...@esmil.dk) wrote:

> ---
>  src/shared/socket-util.c | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
> index e3e54e8..d4a1679 100644
> --- a/src/shared/socket-util.c
> +++ b/src/shared/socket-util.c
> @@ -41,6 +41,16 @@
>  #include "missing.h"
>  #include "fileio.h"
>  
> +/* Don't fail if the standard library
> + * doesn't support IDN */
> +#ifndef NI_IDN
> +#define NI_IDN 0
> +#endif
> +
> +#ifndef NI_IDN_USE_STD3_ASCII_RULES
> +#define NI_IDN_USE_STD3_ASCII_RULES 0
> +#endif

If glibc supports building in a way that these are no defined I am
willing to merge this (though it would belong in missing.h, not into
sockt-util.c). However, I am pretty sure that glibc defines this even
if IDN is disabled in the build, and if that's the case then your libc
should really do the same.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [RFC 09/25] shared/socket-util: don't fail if libc doesn't support IDN

2014-09-18 Thread Emil Renner Berthing
---
 src/shared/socket-util.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index e3e54e8..d4a1679 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -41,6 +41,16 @@
 #include "missing.h"
 #include "fileio.h"
 
+/* Don't fail if the standard library
+ * doesn't support IDN */
+#ifndef NI_IDN
+#define NI_IDN 0
+#endif
+
+#ifndef NI_IDN_USE_STD3_ASCII_RULES
+#define NI_IDN_USE_STD3_ASCII_RULES 0
+#endif
+
 int socket_address_parse(SocketAddress *a, const char *s) {
 char *e, *n;
 unsigned u;
-- 
2.1.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel