Return-Path: Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Delivered-To: mailing list commits@apr.apache.org Received: (qmail 56158 invoked by uid 99); 10 Dec 2004 15:37:40 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 10 Dec 2004 07:37:39 -0800 Received: (qmail 4084 invoked by uid 65534); 10 Dec 2004 15:37:37 -0000 Date: 10 Dec 2004 15:37:37 -0000 Message-ID: <20041210153737.4081.qmail@minotaur.apache.org> From: dreid@apache.org To: commits@apr.apache.org Subject: svn commit: r111513 - /apr/apr/trunk/network_io/unix/sockets.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked Author: dreid Date: Fri Dec 10 07:37:36 2004 New Revision: 111513 URL: http://svn.apache.org/viewcvs?view=rev&rev=111513 Log: Create the correct type of socket when using BeOS R5 with the old net_server code. Contributed by: Ingo Weinhold Reviewed by: David Reid Modified: apr/apr/trunk/network_io/unix/sockets.c Modified: apr/apr/trunk/network_io/unix/sockets.c Url: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/sockets.c?view=diff&rev=111513&p1=apr/apr/trunk/network_io/unix/sockets.c&r1=111512&p2=apr/apr/trunk/network_io/unix/sockets.c&r2=111513 ============================================================================== --- apr/apr/trunk/network_io/unix/sockets.c (original) +++ apr/apr/trunk/network_io/unix/sockets.c Fri Dec 10 07:37:36 2004 @@ -20,9 +20,10 @@ #include "apr_portable.h" #include "apr_arch_inherit.h" -#if defined(BEOS) && !defined(BEOS_BONE) +#ifdef BEOS_R5 +#undef close #define close closesocket -#endif +#endif /* BEOS_R5 */ static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ @@ -92,7 +93,28 @@ alloc_socket(new, cont); +#ifndef BEOS_R5 (*new)->socketdes = socket(family, type, protocol); +#else + /* For some reason BeOS R5 has an unconventional protocol numbering, + * so we need to translate here. */ + switch (protocol) { + case 0: + (*new)->socketdes = socket(family, type, 0); + break; + case APR_PROTO_TCP: + (*new)->socketdes = socket(family, type, IPPROTO_TCP); + break; + case APR_PROTO_UDP: + (*new)->socketdes = socket(family, type, IPPROTO_UDP); + break; + case APR_PROTO_SCTP: + default: + errno = EPROTONOSUPPORT; + (*new)->socketdes = -1; + break; + } +#endif /* BEOS_R5 */ #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) {