You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bj...@apache.org on 2010/03/16 16:44:07 UTC
svn commit: r923815 - /apr/apr/trunk/network_io/os2/sockets.c
Author: bjh
Date: Tue Mar 16 15:44:07 2010
New Revision: 923815
URL: http://svn.apache.org/viewvc?rev=923815&view=rev
Log:
OS/2: In apr_socket_create(), override the supplied protocol if family is
AF_UNIX. This is done in the unix implementation and is required to pass tests
in testsock which pass APR_PROTO_TCP with AF_UNIX.
Modified:
apr/apr/trunk/network_io/os2/sockets.c
Modified: apr/apr/trunk/network_io/os2/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/os2/sockets.c?rev=923815&r1=923814&r2=923815&view=diff
==============================================================================
--- apr/apr/trunk/network_io/os2/sockets.c (original)
+++ apr/apr/trunk/network_io/os2/sockets.c Tue Mar 16 15:44:07 2010
@@ -84,6 +84,7 @@ APR_DECLARE(apr_status_t) apr_socket_cre
{
int downgrade = (family == AF_UNSPEC);
apr_pollfd_t pfd;
+ int oprotocol = protocol;
if (family == AF_UNSPEC) {
#if APR_HAVE_IPV6
@@ -93,6 +94,10 @@ APR_DECLARE(apr_status_t) apr_socket_cre
#endif
}
+ if (family == APR_UNIX) {
+ protocol = 0;
+ }
+
alloc_socket(new, cont);
(*new)->socketdes = socket(family, type, protocol);
@@ -106,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_socket_cre
if ((*new)->socketdes < 0) {
return APR_OS2_STATUS(sock_errno());
}
- set_socket_vars(*new, family, type, protocol);
+ set_socket_vars(*new, family, type, oprotocol);
(*new)->timeout = -1;
(*new)->nonblock = FALSE;