aboutsummaryrefslogtreecommitdiff
path: root/contrib/apr/network_io/unix
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2015-08-09 05:14:25 +0000
committerPeter Wemm <peter@FreeBSD.org>2015-08-09 05:14:25 +0000
commit84a48fac948e7879d70aaa6e5527e20182142cc9 (patch)
tree630fa907bbf67b68f5bda48e89976d92874a7eb0 /contrib/apr/network_io/unix
parentf6f5a3ea2252452479ed37a5f5c496e70b2de4b2 (diff)
parentdf84d2567179e9d8867957c089683d753016bd75 (diff)
downloadsrc-84a48fac948e7879d70aaa6e5527e20182142cc9.tar.gz
src-84a48fac948e7879d70aaa6e5527e20182142cc9.zip
Update apr-1.5.1 to 1.5.2
Notes
Notes: svn path=/head/; revision=286503
Diffstat (limited to 'contrib/apr/network_io/unix')
-rw-r--r--contrib/apr/network_io/unix/sockaddr.c10
-rw-r--r--contrib/apr/network_io/unix/sockets.c34
2 files changed, 36 insertions, 8 deletions
diff --git a/contrib/apr/network_io/unix/sockaddr.c b/contrib/apr/network_io/unix/sockaddr.c
index 0dd1a2d4518d..e6d7e0be93d8 100644
--- a/contrib/apr/network_io/unix/sockaddr.c
+++ b/contrib/apr/network_io/unix/sockaddr.c
@@ -325,6 +325,16 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
hints.ai_flags = AI_ADDRCONFIG;
}
#endif
+
+#ifdef __MVS__
+ /* z/OS will not return IPv4 address under AF_UNSPEC if any IPv6 results
+ * are returned, w/o AI_ALL.
+ */
+ if (family == APR_UNSPEC) {
+ hints.ai_flags |= AI_ALL;
+ }
+#endif
+
if(hostname == NULL) {
#ifdef AI_PASSIVE
/* If hostname is NULL, assume we are trying to bind to all
diff --git a/contrib/apr/network_io/unix/sockets.c b/contrib/apr/network_io/unix/sockets.c
index 514edb1a499a..b95794f183ad 100644
--- a/contrib/apr/network_io/unix/sockets.c
+++ b/contrib/apr/network_io/unix/sockets.c
@@ -145,13 +145,22 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
#ifndef HAVE_SOCK_CLOEXEC
{
int flags;
+ apr_status_t rv;
- if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1)
- return errno;
+ if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) {
+ rv = errno;
+ close((*new)->socketdes);
+ (*new)->socketdes = -1;
+ return rv;
+ }
flags |= FD_CLOEXEC;
- if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
- return errno;
+ if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) {
+ rv = errno;
+ close((*new)->socketdes);
+ (*new)->socketdes = -1;
+ return rv;
+ }
}
#endif
@@ -306,13 +315,22 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
#ifndef HAVE_ACCEPT4
{
int flags;
+ apr_status_t rv;
- if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1)
- return errno;
+ if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) {
+ rv = errno;
+ close((*new)->socketdes);
+ (*new)->socketdes = -1;
+ return rv;
+ }
flags |= FD_CLOEXEC;
- if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
- return errno;
+ if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) {
+ rv = errno;
+ close((*new)->socketdes);
+ (*new)->socketdes = -1;
+ return rv;
+ }
}
#endif