summaryrefslogtreecommitdiff
path: root/network_io/os2
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-12-07 23:29:07 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-12-07 23:29:07 +0000
commit73b477352e6e67ff739dbfa3b6483e3831d7f5e4 (patch)
tree24a871732b4bcfc6b210d03bc786d36c17778765 /network_io/os2
parente704d246caa1cb36870ea8626efa2c8c34c23a00 (diff)
downloadlibapr-73b477352e6e67ff739dbfa3b6483e3831d7f5e4.tar.gz
Fix a bug in OS2 related to AF_UNSPEC, and drop a NETWARE section that
duplicates the correct code. If we need to do something with proto, then _that_ can be hidden in an ifdef WIN32 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/os2')
-rw-r--r--network_io/os2/sockets.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c
index 895b778af..1241e678f 100644
--- a/network_io/os2/sockets.c
+++ b/network_io/os2/sockets.c
@@ -130,10 +130,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p)
(*new)->remote_addr->pool = p;
}
-APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type,
+APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type,
apr_pool_t *cont)
{
- int family = ofamily;
+ int downgrade = (family == AF_UNSPEC);
if (family == AF_UNSPEC) {
#if APR_HAVE_IPV6
@@ -152,9 +152,9 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int
return APR_ENOMEM;
}
- (*new)->socketdes = socket(AF_INET, type, 0);
+ (*new)->socketdes = socket(family, type, 0);
#if APR_HAVE_IPV6
- if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) {
+ if ((*new)->socketdes < 0 && downgrade) {
family = AF_INET;
(*new)->socketdes = socket(family, type, 0);
}