From: Jarkko Hietaniemi Date: Sat, 19 Jan 2002 02:56:26 +0000 (+0000) Subject: Don't do socketpair udp unless you've got all what it takes. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=199de01a14d955a594a64803f2f0cb5c757c2b43;p=p5sagit%2Fp5-mst-13.2.git Don't do socketpair udp unless you've got all what it takes. p4raw-id: //depot/perl@14339 --- diff --git a/util.c b/util.c index 72c85cd..49119ed 100644 --- a/util.c +++ b/util.c @@ -4025,7 +4025,11 @@ Perl_new_vstring(pTHX_ char *s, SV *sv) return s; } -#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) +#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) && defined(AF_INET) && defined(PF_INET) && defined(SOCK_DGRAM) +# define EMULATE_SOCKETPAIR_UDP +#endif + +#ifdef EMULATE_SOCKETPAIR_UDP static int S_socketpair_udp (int fd[2]) { dTHX; @@ -4191,8 +4195,10 @@ Perl_my_socketpair (int family, int type, int protocol, int fd[2]) { return -1; } +#ifdef EMULATE_SOCKETPAIR_UDP if (type == SOCK_DGRAM) return S_socketpair_udp (fd); +#endif listener = PerlSock_socket (AF_INET, type, 0); if (listener == -1)