From 48fc82f99451074c7b80e10b9c9436fc2d7b7cd4 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sat, 15 May 2004 21:19:43 +0000 Subject: move ipv6supported from listen.c to utils.c git-svn-id: https://svn.musicpd.org/mpd/trunk@1026 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/listen.c | 11 +---------- src/utils.c | 13 +++++++++++++ src/utils.h | 2 ++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/listen.c b/src/listen.c index a9624d4e7..49ff4c33e 100644 --- a/src/listen.c +++ b/src/listen.c @@ -20,6 +20,7 @@ #include "interface.h" #include "conf.h" #include "log.h" +#include "utils.h" #include #include @@ -42,16 +43,6 @@ int listenSocket; -#ifdef HAVE_IPV6 -int ipv6Supported() { - int s; - s = socket(AF_INET6,SOCK_STREAM,0); - if(s == -1) return 0; - close(s); - return 1; -} -#endif - int establish(unsigned short port) { int allowReuse = ALLOW_REUSE; int sock; 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 #include #include +#include #include #include #include @@ -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: */ diff --git a/src/utils.h b/src/utils.h index 402867ac9..fd03915f9 100644 --- a/src/utils.h +++ b/src/utils.h @@ -31,5 +31,7 @@ void stripReturnChar(char * string); void my_usleep(long usec); +int ipv6Supported(); + #endif /* vim:set shiftwidth=4 tabstop=8 expandtab: */ -- cgit v1.2.3