From 70223bac46f53f89041db61d2a06ea772968ce2d Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 5 Jan 2006 17:43:06 +0000 Subject: Fallbacks for systems that do not have getaddrinfo(). Does not handle IPv6 though. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@369 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'polyp/util.c') diff --git a/polyp/util.c b/polyp/util.c index 699480af..2c4285fb 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -831,11 +831,14 @@ size_t pa_parsehex(const char *p, uint8_t *d, size_t dlength) { /* Return the fully qualified domain name in *s */ char *pa_get_fqdn(char *s, size_t l) { char hn[256]; +#ifdef HAVE_GETADDRINFO struct addrinfo *a, hints; +#endif if (!pa_get_host_name(hn, sizeof(hn))) return NULL; +#ifdef HAVE_GETADDRINFO memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_flags = AI_CANONNAME; @@ -846,6 +849,9 @@ char *pa_get_fqdn(char *s, size_t l) { pa_strlcpy(s, a->ai_canonname, l); freeaddrinfo(a); return s; +#else + return pa_strlcpy(s, hn, l); +#endif } /* Returns nonzero when *s starts with *pfx */ -- cgit