diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2017-06-15 17:44:59 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-06-16 15:13:16 +0200 |
commit | 6326a143263fc460bbda871d6e74b1d7d2841ea1 (patch) | |
tree | 7ca5b528b82da333a601f480421f451d19c32a39 /src/basic/socket-util.c | |
parent | man: systemd-timesyncd.service(8) (#6109) (diff) | |
download | systemd-6326a143263fc460bbda871d6e74b1d7d2841ea1.tar.xz systemd-6326a143263fc460bbda871d6e74b1d7d2841ea1.zip |
Make IDN support conditional
[zj: rename HAVE_IDN to ENABLE_IDN]
Diffstat (limited to '')
-rw-r--r-- | src/basic/socket-util.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index e5847dce00..49642c2347 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -48,6 +48,12 @@ #include "utf8.h" #include "util.h" +#ifdef ENABLE_IDN +# define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES) +#else +# define IDN_FLAGS 0 +#endif + int socket_address_parse(SocketAddress *a, const char *s) { char *e, *n; unsigned u; @@ -723,8 +729,7 @@ int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret) assert(_ret); - r = getnameinfo(&sa->sa, salen, host, sizeof(host), NULL, 0, - NI_IDN|NI_IDN_USE_STD3_ASCII_RULES); + r = getnameinfo(&sa->sa, salen, host, sizeof(host), NULL, 0, IDN_FLAGS); if (r != 0) { int saved_errno = errno; |