summaryrefslogtreecommitdiffstats
path: root/polyp/util.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-01-05 17:43:06 +0000
committerPierre Ossman <ossman@cendio.se>2006-01-05 17:43:06 +0000
commit70223bac46f53f89041db61d2a06ea772968ce2d (patch)
treeeb5ed55d62e1e65258051e2f8d41a41cf4b45c34 /polyp/util.c
parent3f2ac7eb8ce8db8947f1bfc195f845be0d409fde (diff)
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
Diffstat (limited to 'polyp/util.c')
-rw-r--r--polyp/util.c6
1 files changed, 6 insertions, 0 deletions
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 */