summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-19 02:56:26 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-19 02:56:26 +0000
commit199de01a14d955a594a64803f2f0cb5c757c2b43 (patch)
treea4e6150a12bd75e07a85025a626a6f961a498873
parentd108ee1c9f6b1bc580c17109b52142bc42db90ac (diff)
downloadperl-199de01a14d955a594a64803f2f0cb5c757c2b43.tar.gz
Don't do socketpair udp unless you've got all what it takes.
p4raw-id: //depot/perl@14339
-rw-r--r--util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/util.c b/util.c
index 72c85cdc76..49119edd2d 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)