summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES9
-rw-r--r--NOTICE2
-rw-r--r--STATUS4
-rw-r--r--configure.in20
-rw-r--r--file_io/netware/mktemp.c10
-rw-r--r--file_io/unix/filedup.c25
-rw-r--r--file_io/unix/mktemp.c10
-rw-r--r--file_io/unix/open.c29
-rw-r--r--file_io/win32/open.c2
-rw-r--r--include/apr_strings.h4
-rw-r--r--include/arch/unix/apr_arch_inherit.h12
-rw-r--r--libapr.rc4
-rw-r--r--locks/unix/proc_mutex.c2
-rw-r--r--network_io/unix/sockets.c46
-rw-r--r--poll/unix/epoll.c35
-rw-r--r--poll/unix/kqueue.c25
-rw-r--r--poll/unix/port.c23
-rw-r--r--threadproc/beos/proc.c2
-rw-r--r--threadproc/netware/proc.c2
-rw-r--r--threadproc/os2/proc.c2
-rw-r--r--threadproc/unix/proc.c2
21 files changed, 247 insertions, 23 deletions
diff --git a/CHANGES b/CHANGES
index d58a64717..eb4e9597b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,14 @@
-*- coding: utf-8 -*-
Changes for APR 1.3.6
-
+ *) On Linux/hppa flock() returns EAGAIN instead of EWOULDBLOCK. This
+ causes proc mutex failures.
+ [Stefan Fritsch <sf sfritsch.de>]
+
+ *) Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and
+ associated functions, such as dup3(), accept4(), epoll_create1() etc.,
+ or simply set CLOEXEC flag using fcntl(). PR 46425. [Stefan Fritsch
+ <sf sfritsch.de>, Arkadiusz Miskiewicz <arekm pld-linux.org>]
Changes for APR 1.3.5
diff --git a/NOTICE b/NOTICE
index 7df842dde..1e0abd3aa 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache Portable Runtime
-Copyright 2008 The Apache Software Foundation.
+Copyright (c) 2009 The Apache Software Foundation.
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
diff --git a/STATUS b/STATUS
index b7c3f984f..38ea07c56 100644
--- a/STATUS
+++ b/STATUS
@@ -4,8 +4,8 @@ Last modified at [$Date$]
Releases:
2.0.0 : in development on trunk/
1.4.0 : in development on branches/1.4.x/
- 1.3.6 : tagged June 3, 2009
- 1.3.5 : not released
+ 1.3.6 : tagged July 1, 2009
+ 1.3.5 : released June 5, 2009
1.3.4 : not released
1.3.3 : released August 14, 2008
1.3.2 : released June 23, 2008
diff --git a/configure.in b/configure.in
index e53d9c58d..f41522b4f 100644
--- a/configure.in
+++ b/configure.in
@@ -467,6 +467,9 @@ case $host in
;;
*mingw*)
OSDIR="win32"
+ ac_cv_file__dev_zero="no"
+ ac_cv_func_setpgrp_void="no"
+ apr_cv_tcp_nodelay_with_cork="no"
enable_threads="system_threads"
eolstr="\\n"
proc_mutex_is_global=1
@@ -775,6 +778,23 @@ if test "$apr_cv_epoll" = "yes"; then
AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported])
fi
+dnl ----------------------------- Checking for extended file descriptor handling
+AC_CHECK_FUNCS(dup3 accept4 epoll_create1)
+
+AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec],
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main()
+{
+ return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1;
+}], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])])
+
+if test "$apr_cv_sock_cloexec" = "yes"; then
+ AC_DEFINE([HAVE_SOCK_CLOEXEC], 1, [Define if the SOCK_CLOEXEC flag is supported])
+fi
+
dnl ----------------------------- Checking for missing POSIX thread functions
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r])
diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c
index 2a71af7d6..c86954ff2 100644
--- a/file_io/netware/mktemp.c
+++ b/file_io/netware/mktemp.c
@@ -19,6 +19,7 @@
#include "apr_strings.h" /* prototype of apr_mkstemp() */
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
#include "apr_portable.h" /* for apr_os_file_put() */
+#include "apr_arch_inherit.h"
#include <stdlib.h> /* for mkstemp() - Single Unix */
@@ -43,6 +44,15 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i
if (!(flags & APR_FILE_NOCLEANUP)) {
+ int flags;
+
+ if ((flags = fcntl((*fp)->filedes, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*fp)->filedes, F_SETFD, flags) == -1)
+ return errno;
+
apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
apr_unix_file_cleanup,
apr_unix_child_file_cleanup);
diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c
index adecbb7f0..47ea4f33b 100644
--- a/file_io/unix/filedup.c
+++ b/file_io/unix/filedup.c
@@ -25,13 +25,36 @@ static apr_status_t file_dup(apr_file_t **new_file,
int which_dup)
{
int rv;
-
+#ifdef HAVE_DUP3
+ int flags = 0;
+#endif
+
if (which_dup == 2) {
if ((*new_file) == NULL) {
/* We can't dup2 unless we have a valid new_file */
return APR_EINVAL;
}
+#ifdef HAVE_DUP3
+ if (!((*new_file)->flags & (APR_FILE_NOCLEANUP|APR_INHERIT)))
+ flags |= O_CLOEXEC;
+ rv = dup3(old_file->filedes, (*new_file)->filedes, flags);
+#else
rv = dup2(old_file->filedes, (*new_file)->filedes);
+ if (!((*new_file)->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) {
+ int flags;
+
+ if (rv == -1)
+ return errno;
+
+ if ((flags = fcntl((*new_file)->filedes, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*new_file)->filedes, F_SETFD, flags) == -1)
+ return errno;
+
+ }
+#endif
} else {
rv = dup(old_file->filedes);
}
diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
index 22e0bd5d3..a78b73ae9 100644
--- a/file_io/unix/mktemp.c
+++ b/file_io/unix/mktemp.c
@@ -51,6 +51,7 @@
#include "apr_strings.h" /* prototype of apr_mkstemp() */
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
#include "apr_portable.h" /* for apr_os_file_put() */
+#include "apr_arch_inherit.h"
#ifndef HAVE_MKSTEMP
@@ -203,6 +204,15 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i
(*fp)->fname = apr_pstrdup(p, template);
if (!(flags & APR_FILE_NOCLEANUP)) {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+
apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
apr_unix_file_cleanup,
apr_unix_child_file_cleanup);
diff --git a/file_io/unix/open.c b/file_io/unix/open.c
index 394712740..26db75c4a 100644
--- a/file_io/unix/open.c
+++ b/file_io/unix/open.c
@@ -127,7 +127,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
oflags |= O_BINARY;
}
#endif
-
+
+#ifdef O_CLOEXEC
+ /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
+ */
+ if (!(flag & APR_FILE_NOCLEANUP)) {
+ oflags |= O_CLOEXEC;
+}
+#endif
+
#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
oflags |= O_LARGEFILE;
#elif defined(O_LARGEFILE)
@@ -155,6 +163,16 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
if (fd < 0) {
return errno;
}
+ if (!(flag & APR_FILE_NOCLEANUP)) {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+ }
(*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
(*new)->pool = pool;
@@ -337,6 +355,15 @@ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile)
return APR_EINVAL;
}
if (thefile->flags & APR_INHERIT) {
+ int flags;
+
+ if ((flags = fcntl(thefile->filedes, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(thefile->filedes, F_SETFD, flags) == -1)
+ return errno;
+
thefile->flags &= ~APR_INHERIT;
apr_pool_child_cleanup_set(thefile->pool,
(void *)thefile,
diff --git a/file_io/win32/open.c b/file_io/win32/open.c
index 5735a4471..2e451535b 100644
--- a/file_io/win32/open.c
+++ b/file_io/win32/open.c
@@ -32,7 +32,7 @@
#include "apr_arch_misc.h"
#include "apr_arch_inherit.h"
#include <io.h>
-#include <WinIoCtl.h>
+#include <winioctl.h>
#if APR_HAS_UNICODE_FS
apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen,
diff --git a/include/apr_strings.h b/include/apr_strings.h
index 996f8ceb5..56d12f36c 100644
--- a/include/apr_strings.h
+++ b/include/apr_strings.h
@@ -196,11 +196,11 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
apr_size_t dst_size);
/**
- * Strip spaces from a string
+ * Remove all whitespace from a string
* @param dest The destination string. It is okay to modify the string
* in place. Namely dest == src
* @param src The string to rid the spaces from.
- * @return The destination string, dest.
+ * @return A pointer to the destination string's null terminator.
*/
APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h
index 9a6bdbca5..6ae2435f0 100644
--- a/include/arch/unix/apr_arch_inherit.h
+++ b/include/arch/unix/apr_arch_inherit.h
@@ -27,6 +27,12 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \
if (the##name->flag & APR_FILE_NOCLEANUP) \
return APR_EINVAL; \
if (!(the##name->flag & APR_INHERIT)) { \
+ int flags = fcntl(the##name->name##des, F_GETFD); \
+ if (flags == -1) \
+ return errno; \
+ flags &= ~(FD_CLOEXEC); \
+ if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \
+ return errno; \
the##name->flag |= APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
@@ -41,6 +47,12 @@ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \
if (the##name->flag & APR_FILE_NOCLEANUP) \
return APR_EINVAL; \
if (the##name->flag & APR_INHERIT) { \
+ int flags; \
+ if ((flags = fcntl(the##name->name##des, F_GETFD)) == -1) \
+ return errno; \
+ flags |= FD_CLOEXEC; \
+ if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \
+ return errno; \
the##name->flag &= ~APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
diff --git a/libapr.rc b/libapr.rc
index cd249b97d..ac8094b12 100644
--- a/libapr.rc
+++ b/libapr.rc
@@ -1,6 +1,6 @@
#include "apr_version.h"
-#define APR_COPYRIGHT "Copyright (c) 2008 The Apache Software " \
+#define APR_COPYRIGHT "Copyright (c) 2009 The Apache Software " \
"Foundation or its licensors, as applicable."
#define APR_LICENSE \
@@ -49,7 +49,7 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", APR_LICENSE "\0"
+ VALUE "Comments", APR_LICENSE "\0"
VALUE "CompanyName", "Apache Software Foundation\0"
VALUE "FileDescription", "Apache Portable Runtime Library\0"
VALUE "FileVersion", APR_VERSION_STRING "\0"
diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
index e433230a8..624f48b49 100644
--- a/locks/unix/proc_mutex.c
+++ b/locks/unix/proc_mutex.c
@@ -683,7 +683,7 @@ static apr_status_t proc_mutex_flock_tryacquire(apr_proc_mutex_t *mutex)
rc = flock(mutex->interproc->filedes, LOCK_EX | LOCK_NB);
} while (rc < 0 && errno == EINTR);
if (rc < 0) {
- if (errno == EWOULDBLOCK) {
+ if (errno == EWOULDBLOCK || errno == EAGAIN) {
return APR_EBUSY;
}
return errno;
diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
index 94b26687c..a379b7bdd 100644
--- a/network_io/unix/sockets.c
+++ b/network_io/unix/sockets.c
@@ -83,7 +83,11 @@ apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol)
apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
int protocol, apr_pool_t *cont)
{
- int family = ofamily;
+ int family = ofamily, flags = 0;
+
+#ifdef HAVE_SOCK_CLOEXEC
+ flags |= SOCK_CLOEXEC;
+#endif
if (family == APR_UNSPEC) {
#if APR_HAVE_IPV6
@@ -96,19 +100,19 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
alloc_socket(new, cont);
#ifndef BEOS_R5
- (*new)->socketdes = socket(family, type, protocol);
+ (*new)->socketdes = socket(family, type|flags, 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);
+ (*new)->socketdes = socket(family, type|flags, 0);
break;
case APR_PROTO_TCP:
- (*new)->socketdes = socket(family, type, IPPROTO_TCP);
+ (*new)->socketdes = socket(family, type|flags, IPPROTO_TCP);
break;
case APR_PROTO_UDP:
- (*new)->socketdes = socket(family, type, IPPROTO_UDP);
+ (*new)->socketdes = socket(family, type|flags, IPPROTO_UDP);
break;
case APR_PROTO_SCTP:
default:
@@ -121,7 +125,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
#if APR_HAVE_IPV6
if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) {
family = APR_INET;
- (*new)->socketdes = socket(family, type, protocol);
+ (*new)->socketdes = socket(family, type|flags, protocol);
}
#endif
@@ -130,6 +134,19 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
}
set_socket_vars(*new, family, type, protocol);
+#ifndef HAVE_SOCK_CLOEXEC
+ {
+ int flags;
+
+ if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
+ return errno;
+ }
+#endif
+
(*new)->timeout = -1;
(*new)->inherit = 0;
apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
@@ -181,7 +198,11 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
sa.salen = sizeof(sa.sa);
+#ifdef HAVE_ACCEPT4
+ s = accept4(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen, SOCK_CLOEXEC);
+#else
s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen);
+#endif
if (s < 0) {
return errno;
@@ -255,6 +276,19 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
(*new)->local_interface_unknown = 1;
}
+#ifndef HAVE_ACCEPT4
+ {
+ int flags;
+
+ if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*new)->socketdes, F_SETFD, flags) == -1)
+ return errno;
+ }
+#endif
+
(*new)->inherit = 0;
apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
socket_cleanup);
diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c
index ff9f73cd5..3164de775 100644
--- a/poll/unix/epoll.c
+++ b/poll/unix/epoll.c
@@ -15,6 +15,7 @@
*/
#include "apr_arch_poll_private.h"
+#include "apr_arch_inherit.h"
#ifdef POLLSET_USES_EPOLL
@@ -95,12 +96,29 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
#endif
int fd;
+#ifdef HAVE_EPOLL_CREATE1
+ fd = epoll_create1(EPOLL_CLOEXEC);
+#else
fd = epoll_create(size);
+#endif
if (fd < 0) {
*pollset = NULL;
return errno;
}
+#ifndef HAVE_EPOLL_CREATE1
+ {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+#endif
+
*pollset = apr_palloc(p, sizeof(**pollset));
#if APR_HAS_THREADS
if ((flags & APR_POLLSET_THREADSAFE) &&
@@ -319,12 +337,29 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb,
{
int fd;
+#ifdef HAVE_EPOLL_CREATE1
+ fd = epoll_create1(EPOLL_CLOEXEC);
+#else
fd = epoll_create(size);
+#endif
if (fd < 0) {
*pollcb = NULL;
return apr_get_netos_error();
}
+
+#ifndef HAVE_EPOLL_CREATE1
+ {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+#endif
*pollcb = apr_palloc(p, sizeof(**pollcb));
(*pollcb)->nalloc = size;
diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c
index 501953dc4..b221899c3 100644
--- a/poll/unix/kqueue.c
+++ b/poll/unix/kqueue.c
@@ -15,6 +15,7 @@
*/
#include "apr_arch_poll_private.h"
+#include "apr_arch_inherit.h"
#ifdef POLLSET_USES_KQUEUE
@@ -101,6 +102,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
return apr_get_netos_error();
}
+ {
+ int flags;
+
+ if ((flags = fcntl((*pollset)->kqueue_fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*pollset)->kqueue_fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+
apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup,
apr_pool_cleanup_null);
@@ -309,7 +321,18 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb,
*pollcb = NULL;
return apr_get_netos_error();
}
-
+
+ {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+
*pollcb = apr_palloc(p, sizeof(**pollcb));
(*pollcb)->nalloc = size;
(*pollcb)->pool = p;
diff --git a/poll/unix/port.c b/poll/unix/port.c
index e962152f1..0ed710818 100644
--- a/poll/unix/port.c
+++ b/poll/unix/port.c
@@ -16,6 +16,7 @@
#include "apr_arch_poll_private.h"
#include "apr_atomic.h"
+#include "apr_arch_inherit.h"
#ifdef POLLSET_USES_PORT
@@ -127,6 +128,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
return APR_ENOMEM;
}
+ {
+ int flags;
+
+ if ((flags = fcntl((*pollset)->port_fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl((*pollset)->port_fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+
apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup,
apr_pool_cleanup_null);
@@ -391,6 +403,17 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb,
return apr_get_netos_error();
}
+ {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFD)) == -1)
+ return errno;
+
+ flags |= FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, flags) == -1)
+ return errno;
+ }
+
*pollcb = apr_palloc(p, sizeof(**pollcb));
(*pollcb)->nalloc = size;
(*pollcb)->pool = p;
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
index 2623b70d1..ee8afb8d1 100644
--- a/threadproc/beos/proc.c
+++ b/threadproc/beos/proc.c
@@ -88,7 +88,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
- err, attr->pool)) != APR_SUCCESS)
+ err, attr->pool)) == APR_SUCCESS)
rv = apr_file_inherit_unset(attr->parent_err);
if (rv != APR_SUCCESS)
return rv;
diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
index 5fb26913c..026ca6fd7 100644
--- a/threadproc/netware/proc.c
+++ b/threadproc/netware/proc.c
@@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
- err, attr->pool)) != APR_SUCCESS)
+ err, attr->pool)) == APR_SUCCESS)
rv = apr_file_inherit_unset(attr->parent_err);
if (rv != APR_SUCCESS)
return rv;
diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
index 8e4a4a3b6..bae2785f0 100644
--- a/threadproc/os2/proc.c
+++ b/threadproc/os2/proc.c
@@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
- err, attr->pool)) != APR_SUCCESS)
+ err, attr->pool)) == APR_SUCCESS)
rv = apr_file_inherit_unset(attr->parent_err);
if (rv != APR_SUCCESS)
return rv;
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index d07540138..283706cfb 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
- err, attr->pool)) != APR_SUCCESS)
+ err, attr->pool)) == APR_SUCCESS)
rv = apr_file_inherit_unset(attr->parent_err);
if (rv != APR_SUCCESS)
return rv;