summaryrefslogtreecommitdiff
path: root/network_io/os2
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2010-03-16 15:44:07 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2010-03-16 15:44:07 +0000
commit85540f3eb89f7cbbea6ebf5784ecbe4ac8c95250 (patch)
tree559fd8ab705470b0548f859b1f79e6db4e926d00 /network_io/os2
parent1924f92af790c5cabeccc71edc6f05a798364beb (diff)
downloadlibapr-85540f3eb89f7cbbea6ebf5784ecbe4ac8c95250.tar.gz
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. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@923815 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/os2')
-rw-r--r--network_io/os2/sockets.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c
index bb951e4c8..580272aa5 100644
--- a/network_io/os2/sockets.c
+++ b/network_io/os2/sockets.c
@@ -84,6 +84,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int
{
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_create(apr_socket_t **new, int family, int
#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_create(apr_socket_t **new, int family, int
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;