aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-15 21:19:43 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-15 21:19:43 +0000
commit48fc82f99451074c7b80e10b9c9436fc2d7b7cd4 (patch)
treeec38c50318b3db9f24aa2fe6ab79110bd967e794 /src/utils.c
parent12d3bd0716d7ec01edc06ed48eab3decaaa8b5b9 (diff)
downloadmpd-48fc82f99451074c7b80e10b9c9436fc2d7b7cd4.tar.gz
mpd-48fc82f99451074c7b80e10b9c9436fc2d7b7cd4.tar.xz
mpd-48fc82f99451074c7b80e10b9c9436fc2d7b7cd4.zip
move ipv6supported from listen.c to utils.c
git-svn-id: https://svn.musicpd.org/mpd/trunk@1026 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 7f8609b26..ece410b2c 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/select.h>
#include <sys/time.h>
#include <unistd.h>
@@ -57,4 +58,16 @@ void my_usleep(long usec) {
select(0,NULL,NULL,NULL,&tv);
}
+
+int ipv6Supported() {
+#ifdef HAVE_IPV6
+ int s;
+ s = socket(AF_INET6,SOCK_STREAM,0);
+ if(s == -1) return 0;
+ close(s);
+ return 1;
+#endif
+ return 0;
+}
+
/* vim:set shiftwidth=4 tabstop=8 expandtab: */