View | Details | Raw Unified | Return to bug 46425
Collapse All | Expand All

(-)a/configure.in (+17 lines)
Lines 768-787 AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], Link Here
768
768
769
int main()
769
int main()
770
{
770
{
771
    return epoll_create(5) == -1;
771
    return epoll_create(5) == -1;
772
}], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])])
772
}], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])])
773
773
774
if test "$apr_cv_epoll" = "yes"; then
774
if test "$apr_cv_epoll" = "yes"; then
775
   AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported])
775
   AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported])
776
fi
776
fi
777
777
778
dnl ----------------------------- Checking for extended file descriptor handling
779
AC_CHECK_FUNCS(dup3 accept4 epoll_create1)
780
781
AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec],
782
[AC_TRY_RUN([
783
#include <sys/types.h>
784
#include <sys/socket.h>
785
786
int main()
787
{
788
    return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1;
789
}], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])])
790
791
if test "$apr_cv_sock_cloexec" = "yes"; then
792
   AC_DEFINE([HAVE_SOCK_CLOEXEC], 1, [Define if the SOCK_CLOEXEC flag is supported])
793
fi
794
778
dnl ----------------------------- Checking for missing POSIX thread functions
795
dnl ----------------------------- Checking for missing POSIX thread functions
779
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r])
796
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r])
780
797
781
dnl ----------------------------- Checking for Shared Memory Support 
798
dnl ----------------------------- Checking for Shared Memory Support 
782
echo "${nl}Checking for Shared Memory Support..."
799
echo "${nl}Checking for Shared Memory Support..."
783
800
784
# The real-time POSIX extensions (e.g. shm_*, sem_*) may only
801
# The real-time POSIX extensions (e.g. shm_*, sem_*) may only
785
# be available if linking against librt.
802
# be available if linking against librt.
786
AC_SEARCH_LIBS(shm_open, rt)
803
AC_SEARCH_LIBS(shm_open, rt)
787
804
(-)a/file_io/netware/mktemp.c (+2 lines)
Lines 12-31 Link Here
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
16
17
#include "apr_private.h"
17
#include "apr_private.h"
18
#include "apr_file_io.h" /* prototype of apr_mkstemp() */
18
#include "apr_file_io.h" /* prototype of apr_mkstemp() */
19
#include "apr_strings.h" /* prototype of apr_mkstemp() */
19
#include "apr_strings.h" /* prototype of apr_mkstemp() */
20
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
20
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
21
#include "apr_portable.h" /* for apr_os_file_put() */
21
#include "apr_portable.h" /* for apr_os_file_put() */
22
#include "apr_arch_inherit.h"
22
23
23
#include <stdlib.h> /* for mkstemp() - Single Unix */
24
#include <stdlib.h> /* for mkstemp() - Single Unix */
24
25
25
APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p)
26
APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p)
26
{
27
{
27
    int fd;
28
    int fd;
28
    apr_status_t rv;
29
    apr_status_t rv;
29
30
30
    flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE |  
31
    flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE |  
31
                       APR_DELONCLOSE : flags & ~APR_EXCL;
32
                       APR_DELONCLOSE : flags & ~APR_EXCL;
Lines 36-54 APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i Link Here
36
    }
37
    }
37
    /* We need to reopen the file to get rid of the o_excl flag.
38
    /* We need to reopen the file to get rid of the o_excl flag.
38
     * Otherwise file locking will not allow the file to be shared.
39
     * Otherwise file locking will not allow the file to be shared.
39
     */
40
     */
40
    close(fd);
41
    close(fd);
41
    if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP,
42
    if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP,
42
                            APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) {
43
                            APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) {
43
44
44
45
45
	if (!(flags & APR_FILE_NOCLEANUP)) {
46
	if (!(flags & APR_FILE_NOCLEANUP)) {
47
            APR_SET_FD_CLOEXEC((*fp)->filedes);
46
	    apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
48
	    apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
47
				      apr_unix_file_cleanup,
49
				      apr_unix_file_cleanup,
48
				      apr_unix_child_file_cleanup);
50
				      apr_unix_child_file_cleanup);
49
	}
51
	}
50
    }
52
    }
51
53
52
    return rv;
54
    return rv;
53
}
55
}
54
56
(-)a/file_io/unix/filedup.c (-1 / +12 lines)
Lines 17-44 Link Here
17
#include "apr_arch_file_io.h"
17
#include "apr_arch_file_io.h"
18
#include "apr_strings.h"
18
#include "apr_strings.h"
19
#include "apr_portable.h"
19
#include "apr_portable.h"
20
#include "apr_thread_mutex.h"
20
#include "apr_thread_mutex.h"
21
#include "apr_arch_inherit.h"
21
#include "apr_arch_inherit.h"
22
22
23
static apr_status_t file_dup(apr_file_t **new_file, 
23
static apr_status_t file_dup(apr_file_t **new_file, 
24
                             apr_file_t *old_file, apr_pool_t *p,
24
                             apr_file_t *old_file, apr_pool_t *p,
25
                             int which_dup)
25
                             int which_dup)
26
{
26
{
27
    int rv;
27
    int rv, flags = 0;
28
    
28
    
29
    if (which_dup == 2) {
29
    if (which_dup == 2) {
30
        if ((*new_file) == NULL) {
30
        if ((*new_file) == NULL) {
31
            /* We can't dup2 unless we have a valid new_file */
31
            /* We can't dup2 unless we have a valid new_file */
32
            return APR_EINVAL;
32
            return APR_EINVAL;
33
        }
33
        }
34
#ifdef HAVE_DUP3
35
        if (!(old_file->flags & APR_INHERIT))
36
            flags |= O_CLOEXEC;
37
        rv = dup3(old_file->filedes, (*new_file)->filedes, flags);
38
#else
34
        rv = dup2(old_file->filedes, (*new_file)->filedes);
39
        rv = dup2(old_file->filedes, (*new_file)->filedes);
40
        if (!(old_file->flags & APR_INHERIT)) {
41
            if (rv == -1)
42
                return errno;
43
            APR_SET_FD_CLOEXEC((*new_file)->filedes);
44
        }
45
#endif
35
    } else {
46
    } else {
36
        rv = dup(old_file->filedes);
47
        rv = dup(old_file->filedes);
37
    }
48
    }
38
49
39
    if (rv == -1)
50
    if (rv == -1)
40
        return errno;
51
        return errno;
41
    
52
    
42
    if (which_dup == 1) {
53
    if (which_dup == 1) {
43
        (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
54
        (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
44
        (*new_file)->pool = p;
55
        (*new_file)->pool = p;
(-)a/file_io/unix/mktemp.c (+2 lines)
Lines 44-63 Link Here
44
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
44
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46
 * SUCH DAMAGE.
46
 * SUCH DAMAGE.
47
 */
47
 */
48
48
49
#include "apr_private.h"
49
#include "apr_private.h"
50
#include "apr_file_io.h" /* prototype of apr_mkstemp() */
50
#include "apr_file_io.h" /* prototype of apr_mkstemp() */
51
#include "apr_strings.h" /* prototype of apr_mkstemp() */
51
#include "apr_strings.h" /* prototype of apr_mkstemp() */
52
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
52
#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
53
#include "apr_portable.h" /* for apr_os_file_put() */
53
#include "apr_portable.h" /* for apr_os_file_put() */
54
#include "apr_arch_inherit.h"
54
55
55
#ifndef HAVE_MKSTEMP
56
#ifndef HAVE_MKSTEMP
56
57
57
#if defined(SVR4) || defined(WIN32) || defined(NETWARE)
58
#if defined(SVR4) || defined(WIN32) || defined(NETWARE)
58
#ifdef SVR4
59
#ifdef SVR4
59
#if HAVE_INTTYPES_H
60
#if HAVE_INTTYPES_H
60
#include <inttypes.h>
61
#include <inttypes.h>
61
#endif
62
#endif
62
#endif
63
#endif
63
#define arc4random() rand()
64
#define arc4random() rand()
Lines 196-213 APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i Link Here
196
     * mkstemp didn't subscribe to our preference flags.
197
     * mkstemp didn't subscribe to our preference flags.
197
     *
198
     *
198
     * We either have to unset the flags, or fix up the fd and other
199
     * We either have to unset the flags, or fix up the fd and other
199
     * xthread and inherit bits appropriately.  Since gettemp() above
200
     * xthread and inherit bits appropriately.  Since gettemp() above
200
     * calls apr_file_open, our flags are respected in that code path.
201
     * calls apr_file_open, our flags are respected in that code path.
201
     */
202
     */
202
    apr_os_file_put(fp, &fd, flags, p);
203
    apr_os_file_put(fp, &fd, flags, p);
203
    (*fp)->fname = apr_pstrdup(p, template);
204
    (*fp)->fname = apr_pstrdup(p, template);
204
205
205
    if (!(flags & APR_FILE_NOCLEANUP)) {
206
    if (!(flags & APR_FILE_NOCLEANUP)) {
207
        APR_SET_FD_CLOEXEC(fd);
206
        apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
208
        apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
207
                                  apr_unix_file_cleanup,
209
                                  apr_unix_file_cleanup,
208
                                  apr_unix_child_file_cleanup);
210
                                  apr_unix_child_file_cleanup);
209
    }
211
    }
210
#endif
212
#endif
211
    return APR_SUCCESS;
213
    return APR_SUCCESS;
212
}
214
}
213
215
(-)a/file_io/unix/open.c (-1 / +13 lines)
Lines 120-140 APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, Link Here
120
        oflags |= O_APPEND;
120
        oflags |= O_APPEND;
121
    }
121
    }
122
    if (flag & APR_TRUNCATE) {
122
    if (flag & APR_TRUNCATE) {
123
        oflags |= O_TRUNC;
123
        oflags |= O_TRUNC;
124
    }
124
    }
125
#ifdef O_BINARY
125
#ifdef O_BINARY
126
    if (flag & APR_BINARY) {
126
    if (flag & APR_BINARY) {
127
        oflags |= O_BINARY;
127
        oflags |= O_BINARY;
128
    }
128
    }
129
#endif
129
#endif
130
    
130
131
#ifdef O_CLOEXEC
132
    /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
133
     */
134
    if (!(flag & APR_FILE_NOCLEANUP)) {
135
        oflags |= O_CLOEXEC;
136
}
137
#endif
138
 
131
#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
139
#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
132
    oflags |= O_LARGEFILE;
140
    oflags |= O_LARGEFILE;
133
#elif defined(O_LARGEFILE)
141
#elif defined(O_LARGEFILE)
134
    if (flag & APR_LARGEFILE) {
142
    if (flag & APR_LARGEFILE) {
135
        oflags |= O_LARGEFILE;
143
        oflags |= O_LARGEFILE;
136
    }
144
    }
137
#endif
145
#endif
138
146
139
#if APR_HAS_THREADS
147
#if APR_HAS_THREADS
140
    if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) {
148
    if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) {
Lines 148-167 APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, Link Here
148
156
149
    if (perm == APR_OS_DEFAULT) {
157
    if (perm == APR_OS_DEFAULT) {
150
        fd = open(fname, oflags, 0666);
158
        fd = open(fname, oflags, 0666);
151
    }
159
    }
152
    else {
160
    else {
153
        fd = open(fname, oflags, apr_unix_perms2mode(perm));
161
        fd = open(fname, oflags, apr_unix_perms2mode(perm));
154
    } 
162
    } 
155
    if (fd < 0) {
163
    if (fd < 0) {
156
       return errno;
164
       return errno;
157
    }
165
    }
166
    if (!(flag & APR_FILE_NOCLEANUP)) {
167
	APR_SET_FD_CLOEXEC(fd);
168
    }
158
169
159
    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
170
    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
160
    (*new)->pool = pool;
171
    (*new)->pool = pool;
161
    (*new)->flags = flag;
172
    (*new)->flags = flag;
162
    (*new)->filedes = fd;
173
    (*new)->filedes = fd;
163
174
164
    (*new)->fname = apr_pstrdup(pool, fname);
175
    (*new)->fname = apr_pstrdup(pool, fname);
165
176
166
    (*new)->blocking = BLK_ON;
177
    (*new)->blocking = BLK_ON;
167
    (*new)->buffered = (flag & APR_BUFFERED) > 0;
178
    (*new)->buffered = (flag & APR_BUFFERED) > 0;
Lines 330-349 APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) Link Here
330
341
331
/* We need to do this by hand instead of using APR_IMPLEMENT_INHERIT_UNSET
342
/* We need to do this by hand instead of using APR_IMPLEMENT_INHERIT_UNSET
332
 * because the macro sets both cleanups to the same function, which is not
343
 * because the macro sets both cleanups to the same function, which is not
333
 * suitable on Unix (see PR 41119). */
344
 * suitable on Unix (see PR 41119). */
334
APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile)
345
APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile)
335
{
346
{
336
    if (thefile->flags & APR_FILE_NOCLEANUP) {
347
    if (thefile->flags & APR_FILE_NOCLEANUP) {
337
        return APR_EINVAL;
348
        return APR_EINVAL;
338
    }
349
    }
339
    if (thefile->flags & APR_INHERIT) {
350
    if (thefile->flags & APR_INHERIT) {
351
        APR_SET_FD_CLOEXEC(thefile->filedes);
340
        thefile->flags &= ~APR_INHERIT;
352
        thefile->flags &= ~APR_INHERIT;
341
        apr_pool_child_cleanup_set(thefile->pool,
353
        apr_pool_child_cleanup_set(thefile->pool,
342
                                   (void *)thefile,
354
                                   (void *)thefile,
343
                                   apr_unix_file_cleanup,
355
                                   apr_unix_file_cleanup,
344
                                   apr_unix_child_file_cleanup);
356
                                   apr_unix_child_file_cleanup);
345
    }
357
    }
346
    return APR_SUCCESS;
358
    return APR_SUCCESS;
347
}
359
}
348
360
349
APR_POOL_IMPLEMENT_ACCESSOR(file)
361
APR_POOL_IMPLEMENT_ACCESSOR(file)
(-)a/include/arch/unix/apr_arch_inherit.h (+17 lines)
Lines 20-52 Link Here
20
#include "apr_inherit.h"
20
#include "apr_inherit.h"
21
21
22
#define APR_INHERIT (1 << 24)    /* Must not conflict with other bits */
22
#define APR_INHERIT (1 << 24)    /* Must not conflict with other bits */
23
23
24
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
24
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
25
apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name)    \
25
apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name)    \
26
{                                                                   \
26
{                                                                   \
27
    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
27
    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
28
        return APR_EINVAL;                                          \
28
        return APR_EINVAL;                                          \
29
    if (!(the##name->flag & APR_INHERIT)) {                         \
29
    if (!(the##name->flag & APR_INHERIT)) {                         \
30
        int flags = fcntl(the##name->name##des, F_GETFD);           \
31
        if (flags == -1)                                            \
32
            return errno;                                           \
33
        flags &= ~(FD_CLOEXEC);                                     \
34
        if (fcntl(the##name->name##des, F_SETFD, flags) == -1)      \
35
            return errno;                                           \
30
        the##name->flag |= APR_INHERIT;                             \
36
        the##name->flag |= APR_INHERIT;                             \
31
        apr_pool_child_cleanup_set(the##name->pool,                 \
37
        apr_pool_child_cleanup_set(the##name->pool,                 \
32
                                   (void *)the##name,               \
38
                                   (void *)the##name,               \
33
                                   cleanup, apr_pool_cleanup_null); \
39
                                   cleanup, apr_pool_cleanup_null); \
34
    }                                                               \
40
    }                                                               \
35
    return APR_SUCCESS;                                             \
41
    return APR_SUCCESS;                                             \
36
}
42
}
37
43
44
#define APR_SET_FD_CLOEXEC(fd)                                      \
45
do {                                                                \
46
    int flags;                                                      \
47
    if ((flags = fcntl(fd, F_GETFD)) == -1)                         \
48
        return errno;                                               \
49
    flags |= FD_CLOEXEC;                                            \
50
    if (fcntl(fd, F_SETFD, flags) == -1)                            \
51
        return errno;                                               \
52
} while (0)
53
38
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
54
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
39
apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name)  \
55
apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name)  \
40
{                                                                   \
56
{                                                                   \
41
    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
57
    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
42
        return APR_EINVAL;                                          \
58
        return APR_EINVAL;                                          \
43
    if (the##name->flag & APR_INHERIT) {                            \
59
    if (the##name->flag & APR_INHERIT) {                            \
60
        APR_SET_FD_CLOEXEC(the##name->name##des);                   \
44
        the##name->flag &= ~APR_INHERIT;                            \
61
        the##name->flag &= ~APR_INHERIT;                            \
45
        apr_pool_child_cleanup_set(the##name->pool,                 \
62
        apr_pool_child_cleanup_set(the##name->pool,                 \
46
                                   (void *)the##name,               \
63
                                   (void *)the##name,               \
47
                                   cleanup, cleanup);               \
64
                                   cleanup, cleanup);               \
48
    }                                                               \
65
    }                                                               \
49
    return APR_SUCCESS;                                             \
66
    return APR_SUCCESS;                                             \
50
}
67
}
51
68
52
#endif	/* ! INHERIT_H */
69
#endif	/* ! INHERIT_H */
(-)a/network_io/unix/sockets.c (-6 / +22 lines)
Lines 101-172 static void alloc_socket(apr_socket_t **new, apr_pool_t *p) Link Here
101
101
102
apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol)
102
apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol)
103
{
103
{
104
    *protocol = sock->protocol;
104
    *protocol = sock->protocol;
105
    return APR_SUCCESS;
105
    return APR_SUCCESS;
106
}
106
}
107
107
108
apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
108
apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
109
                               int protocol, apr_pool_t *cont)
109
                               int protocol, apr_pool_t *cont)
110
{
110
{
111
    int family = ofamily;
111
    int family = ofamily, flags = 0;
112
    int oprotocol = protocol;
112
    int oprotocol = protocol;
113
113
114
#ifdef HAVE_SOCK_CLOEXEC
115
    flags |= SOCK_CLOEXEC;
116
#endif
117
114
    if (family == APR_UNSPEC) {
118
    if (family == APR_UNSPEC) {
115
#if APR_HAVE_IPV6
119
#if APR_HAVE_IPV6
116
        family = APR_INET6;
120
        family = APR_INET6;
117
#else
121
#else
118
        family = APR_INET;
122
        family = APR_INET;
119
#endif
123
#endif
120
    }
124
    }
121
#if APR_HAVE_SOCKADDR_UN
125
#if APR_HAVE_SOCKADDR_UN
122
    if (family == APR_UNIX) {
126
    if (family == APR_UNIX) {
123
        protocol = 0;
127
        protocol = 0;
124
    }
128
    }
125
#endif
129
#endif
126
    alloc_socket(new, cont);
130
    alloc_socket(new, cont);
127
131
128
#ifndef BEOS_R5
132
#ifndef BEOS_R5
129
    (*new)->socketdes = socket(family, type, protocol);
133
    (*new)->socketdes = socket(family, type|flags, protocol);
130
#else
134
#else
131
    /* For some reason BeOS R5 has an unconventional protocol numbering,
135
    /* For some reason BeOS R5 has an unconventional protocol numbering,
132
     * so we need to translate here. */
136
     * so we need to translate here. */
133
    switch (protocol) {
137
    switch (protocol) {
134
    case 0:
138
    case 0:
135
        (*new)->socketdes = socket(family, type, 0);
139
        (*new)->socketdes = socket(family, type|flags, 0);
136
        break;
140
        break;
137
    case APR_PROTO_TCP:
141
    case APR_PROTO_TCP:
138
        (*new)->socketdes = socket(family, type, IPPROTO_TCP);
142
        (*new)->socketdes = socket(family, type|flags, IPPROTO_TCP);
139
        break;
143
        break;
140
    case APR_PROTO_UDP:
144
    case APR_PROTO_UDP:
141
        (*new)->socketdes = socket(family, type, IPPROTO_UDP);
145
        (*new)->socketdes = socket(family, type|flags, IPPROTO_UDP);
142
        break;
146
        break;
143
    case APR_PROTO_SCTP:
147
    case APR_PROTO_SCTP:
144
    default:
148
    default:
145
        errno = EPROTONOSUPPORT;
149
        errno = EPROTONOSUPPORT;
146
        (*new)->socketdes = -1;
150
        (*new)->socketdes = -1;
147
        break;
151
        break;
148
    }
152
    }
149
#endif /* BEOS_R5 */
153
#endif /* BEOS_R5 */
150
154
151
#if APR_HAVE_IPV6
155
#if APR_HAVE_IPV6
152
    if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) {
156
    if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) {
153
        family = APR_INET;
157
        family = APR_INET;
154
        (*new)->socketdes = socket(family, type, protocol);
158
        (*new)->socketdes = socket(family, type|flags, protocol);
155
    }
159
    }
156
#endif
160
#endif
157
161
158
    if ((*new)->socketdes < 0) {
162
    if ((*new)->socketdes < 0) {
159
        return errno;
163
        return errno;
160
    }
164
    }
161
    set_socket_vars(*new, family, type, oprotocol);
165
    set_socket_vars(*new, family, type, oprotocol);
162
166
167
#ifndef HAVE_SOCK_CLOEXEC
168
    APR_SET_FD_CLOEXEC((*new)->socketdes);
169
#endif
170
163
    (*new)->timeout = -1;
171
    (*new)->timeout = -1;
164
    (*new)->inherit = 0;
172
    (*new)->inherit = 0;
165
    apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
173
    apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
166
                              socket_child_cleanup);
174
                              socket_child_cleanup);
167
175
168
    return APR_SUCCESS;
176
    return APR_SUCCESS;
169
} 
177
} 
170
178
171
apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, 
179
apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, 
172
                                 apr_shutdown_how_e how)
180
                                 apr_shutdown_how_e how)
Lines 211-231 apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) Link Here
211
}
219
}
212
220
213
apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
221
apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
214
                               apr_pool_t *connection_context)
222
                               apr_pool_t *connection_context)
215
{
223
{
216
    int s;
224
    int s;
217
    apr_sockaddr_t sa;
225
    apr_sockaddr_t sa;
218
226
219
    sa.salen = sizeof(sa.sa);
227
    sa.salen = sizeof(sa.sa);
220
228
229
#ifdef HAVE_ACCEPT4
230
    s = accept4(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen, SOCK_CLOEXEC);
231
#else
221
    s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen);
232
    s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen);
233
#endif
222
234
223
    if (s < 0) {
235
    if (s < 0) {
224
        return errno;
236
        return errno;
225
    }
237
    }
226
#ifdef TPF
238
#ifdef TPF
227
    if (s == 0) { 
239
    if (s == 0) { 
228
        /* 0 is an invalid socket for TPF */
240
        /* 0 is an invalid socket for TPF */
229
        return APR_EINTR;
241
        return APR_EINTR;
230
    }
242
    }
231
#endif
243
#endif
Lines 293-312 apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, Link Here
293
                sock->local_addr->ipaddr_len)) {
305
                sock->local_addr->ipaddr_len)) {
294
        /* If the interface address inside the listening socket's local_addr wasn't 
306
        /* If the interface address inside the listening socket's local_addr wasn't 
295
         * up-to-date, we don't know local interface of the connected socket either.
307
         * up-to-date, we don't know local interface of the connected socket either.
296
         *
308
         *
297
         * If the listening socket was not bound to a specific interface, we
309
         * If the listening socket was not bound to a specific interface, we
298
         * don't know the local_addr of the connected socket.
310
         * don't know the local_addr of the connected socket.
299
         */
311
         */
300
        (*new)->local_interface_unknown = 1;
312
        (*new)->local_interface_unknown = 1;
301
    }
313
    }
302
314
315
#ifndef HAVE_ACCEPT4
316
    APR_SET_FD_CLOEXEC((*new)->socketdes);
317
#endif
318
303
    (*new)->inherit = 0;
319
    (*new)->inherit = 0;
304
    apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
320
    apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup,
305
                              socket_cleanup);
321
                              socket_cleanup);
306
    return APR_SUCCESS;
322
    return APR_SUCCESS;
307
}
323
}
308
324
309
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
325
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
310
{
326
{
311
    int rc;        
327
    int rc;        
312
328
(-)a/poll/unix/epoll.c (-1 / +18 lines)
Lines 14-33 Link Here
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
16
17
#include "apr.h"
17
#include "apr.h"
18
#include "apr_poll.h"
18
#include "apr_poll.h"
19
#include "apr_time.h"
19
#include "apr_time.h"
20
#include "apr_portable.h"
20
#include "apr_portable.h"
21
#include "apr_arch_file_io.h"
21
#include "apr_arch_file_io.h"
22
#include "apr_arch_networkio.h"
22
#include "apr_arch_networkio.h"
23
#include "apr_arch_poll_private.h"
23
#include "apr_arch_poll_private.h"
24
#include "apr_arch_inherit.h"
24
25
25
#if defined(HAVE_EPOLL)
26
#if defined(HAVE_EPOLL)
26
27
27
static apr_int16_t get_epoll_event(apr_int16_t event)
28
static apr_int16_t get_epoll_event(apr_int16_t event)
28
{
29
{
29
    apr_int16_t rv = 0;
30
    apr_int16_t rv = 0;
30
31
31
    if (event & APR_POLLIN)
32
    if (event & APR_POLLIN)
32
        rv |= EPOLLIN;
33
        rv |= EPOLLIN;
33
    if (event & APR_POLLPRI)
34
    if (event & APR_POLLPRI)
Lines 88-113 static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) Link Here
88
89
89
90
90
static apr_status_t impl_pollset_create(apr_pollset_t *pollset,
91
static apr_status_t impl_pollset_create(apr_pollset_t *pollset,
91
                                        apr_uint32_t size,
92
                                        apr_uint32_t size,
92
                                        apr_pool_t *p,
93
                                        apr_pool_t *p,
93
                                        apr_uint32_t flags)
94
                                        apr_uint32_t flags)
94
{
95
{
95
    apr_status_t rv;
96
    apr_status_t rv;
96
    int fd;
97
    int fd;
97
98
99
#ifdef HAVE_EPOLL_CREATE1
100
    fd = epoll_create1(EPOLL_CLOEXEC);
101
#else
98
    fd = epoll_create(size);
102
    fd = epoll_create(size);
103
#endif
99
    if (fd < 0) {
104
    if (fd < 0) {
100
        pollset->p = NULL;
105
        pollset->p = NULL;
101
        return apr_get_netos_error();
106
        return apr_get_netos_error();
102
    }
107
    }
103
108
109
#ifndef HAVE_EPOLL_CREATE1
110
    APR_SET_FD_CLOEXEC(fd);
111
#endif
112
104
    pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t));
113
    pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t));
105
#if APR_HAS_THREADS
114
#if APR_HAS_THREADS
106
    if ((flags & APR_POLLSET_THREADSAFE) &&
115
    if ((flags & APR_POLLSET_THREADSAFE) &&
107
        !(flags & APR_POLLSET_NOCOPY) &&
116
        !(flags & APR_POLLSET_NOCOPY) &&
108
        ((rv = apr_thread_mutex_create(&pollset->p->ring_lock,
117
        ((rv = apr_thread_mutex_create(&pollset->p->ring_lock,
109
                                       APR_THREAD_MUTEX_DEFAULT,
118
                                       APR_THREAD_MUTEX_DEFAULT,
110
                                       p)) != APR_SUCCESS)) {
119
                                       p)) != APR_SUCCESS)) {
111
        pollset->p = NULL;
120
        pollset->p = NULL;
112
        return rv;
121
        return rv;
113
    }
122
    }
Lines 312-340 static apr_status_t cb_cleanup(void *p_) Link Here
312
    return APR_SUCCESS;
321
    return APR_SUCCESS;
313
}
322
}
314
323
315
static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb,
324
static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb,
316
                                       apr_uint32_t size,
325
                                       apr_uint32_t size,
317
                                       apr_pool_t *p,
326
                                       apr_pool_t *p,
318
                                       apr_uint32_t flags)
327
                                       apr_uint32_t flags)
319
{
328
{
320
    int fd;
329
    int fd;
321
    
330
    
331
#ifdef HAVE_EPOLL_CREATE1
332
    fd = epoll_create1(EPOLL_CLOEXEC);
333
#else
322
    fd = epoll_create(size);
334
    fd = epoll_create(size);
335
#endif
323
    
336
    
324
    if (fd < 0) {
337
    if (fd < 0) {
325
        return apr_get_netos_error();
338
        return apr_get_netos_error();
326
    }
339
    }
340
341
#ifndef HAVE_EPOLL_CREATE1
342
    APR_SET_FD_CLOEXEC(fd);
343
#endif
327
    
344
    
328
    pollcb->fd = fd;
345
    pollcb->fd = fd;
329
    pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event));
346
    pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event));
330
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup);
347
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null);
331
348
332
    return APR_SUCCESS;
349
    return APR_SUCCESS;
333
}
350
}
334
351
335
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
352
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
336
                                    apr_pollfd_t *descriptor)
353
                                    apr_pollfd_t *descriptor)
337
{
354
{
338
    struct epoll_event ev;
355
    struct epoll_event ev;
339
    int ret;
356
    int ret;
340
    
357
    
(-)a/poll/unix/kqueue.c (-2 / +7 lines)
Lines 14-33 Link Here
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
16
17
#include "apr.h"
17
#include "apr.h"
18
#include "apr_poll.h"
18
#include "apr_poll.h"
19
#include "apr_time.h"
19
#include "apr_time.h"
20
#include "apr_portable.h"
20
#include "apr_portable.h"
21
#include "apr_arch_file_io.h"
21
#include "apr_arch_file_io.h"
22
#include "apr_arch_networkio.h"
22
#include "apr_arch_networkio.h"
23
#include "apr_arch_poll_private.h"
23
#include "apr_arch_poll_private.h"
24
#include "apr_arch_inherit.h"
24
25
25
#ifdef HAVE_KQUEUE
26
#ifdef HAVE_KQUEUE
26
27
27
static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags)
28
static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags)
28
{
29
{
29
    apr_int16_t rv = 0;
30
    apr_int16_t rv = 0;
30
31
31
    if (event == EVFILT_READ)
32
    if (event == EVFILT_READ)
32
        rv |= APR_POLLIN;
33
        rv |= APR_POLLIN;
33
    if (event == EVFILT_WRITE)
34
    if (event == EVFILT_WRITE)
Lines 91-110 static apr_status_t impl_pollset_create(apr_pollset_t *pollset, Link Here
91
        (struct kevent *) apr_palloc(p, size * sizeof(struct kevent));
92
        (struct kevent *) apr_palloc(p, size * sizeof(struct kevent));
92
93
93
    memset(pollset->p->ke_set, 0, size * sizeof(struct kevent));
94
    memset(pollset->p->ke_set, 0, size * sizeof(struct kevent));
94
95
95
    pollset->p->kqueue_fd = kqueue();
96
    pollset->p->kqueue_fd = kqueue();
96
97
97
    if (pollset->p->kqueue_fd == -1) {
98
    if (pollset->p->kqueue_fd == -1) {
98
        return apr_get_netos_error();
99
        return apr_get_netos_error();
99
    }
100
    }
100
101
102
    APR_SET_FD_CLOEXEC(pollset->p->kqueue_fd);
103
101
    pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
104
    pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
102
105
103
    APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link);
106
    APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link);
104
    APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link);
107
    APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link);
105
    APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link);
108
    APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link);
106
109
107
    return rv;
110
    return rv;
108
}
111
}
109
112
110
static apr_status_t impl_pollset_add(apr_pollset_t *pollset,
113
static apr_status_t impl_pollset_add(apr_pollset_t *pollset,
Lines 305-328 static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, Link Here
305
                                       apr_uint32_t size,
308
                                       apr_uint32_t size,
306
                                       apr_pool_t *p,
309
                                       apr_pool_t *p,
307
                                       apr_uint32_t flags)
310
                                       apr_uint32_t flags)
308
{
311
{
309
    int fd;
312
    int fd;
310
    
313
    
311
    fd = kqueue();
314
    fd = kqueue();
312
    if (fd < 0) {
315
    if (fd < 0) {
313
        return apr_get_netos_error();
316
        return apr_get_netos_error();
314
    }
317
    }
315
    
318
319
    APR_SET_FD_CLOEXEC(fd);
320
 
316
    pollcb->fd = fd;
321
    pollcb->fd = fd;
317
    pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent));
322
    pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent));
318
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup);
323
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null);
319
    
324
    
320
    return APR_SUCCESS;
325
    return APR_SUCCESS;
321
}
326
}
322
327
323
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
328
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
324
                                    apr_pollfd_t *descriptor)
329
                                    apr_pollfd_t *descriptor)
325
{
330
{
326
    apr_os_sock_t fd;
331
    apr_os_sock_t fd;
327
    struct kevent ev;
332
    struct kevent ev;
328
    apr_status_t rv = APR_SUCCESS;
333
    apr_status_t rv = APR_SUCCESS;
(-)a/poll/unix/pollset.c (+5 lines)
Lines 19-38 Link Here
19
#define FD_SETSIZE 1024
19
#define FD_SETSIZE 1024
20
#endif
20
#endif
21
21
22
#include "apr.h"
22
#include "apr.h"
23
#include "apr_poll.h"
23
#include "apr_poll.h"
24
#include "apr_time.h"
24
#include "apr_time.h"
25
#include "apr_portable.h"
25
#include "apr_portable.h"
26
#include "apr_arch_file_io.h"
26
#include "apr_arch_file_io.h"
27
#include "apr_arch_networkio.h"
27
#include "apr_arch_networkio.h"
28
#include "apr_arch_poll_private.h"
28
#include "apr_arch_poll_private.h"
29
#include "apr_arch_inherit.h"
29
30
30
static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD;
31
static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD;
31
32
32
#if !APR_FILES_AS_SOCKETS
33
#if !APR_FILES_AS_SOCKETS
33
#if defined (WIN32)
34
#if defined (WIN32)
34
35
35
extern apr_status_t
36
extern apr_status_t
36
apr_file_socket_pipe_create(apr_file_t **in,
37
apr_file_socket_pipe_create(apr_file_t **in,
37
                            apr_file_t **out,
38
                            apr_file_t **out,
38
                            apr_pool_t *p);
39
                            apr_pool_t *p);
Lines 80-99 static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) Link Here
80
    apr_status_t rv;
81
    apr_status_t rv;
81
    apr_pollfd_t fd;
82
    apr_pollfd_t fd;
82
83
83
    if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0],
84
    if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0],
84
                                   &pollset->wakeup_pipe[1],
85
                                   &pollset->wakeup_pipe[1],
85
                                   pollset->pool)) != APR_SUCCESS)
86
                                   pollset->pool)) != APR_SUCCESS)
86
        return rv;
87
        return rv;
87
    fd.reqevents = APR_POLLIN;
88
    fd.reqevents = APR_POLLIN;
88
    fd.desc_type = APR_POLL_FILE;
89
    fd.desc_type = APR_POLL_FILE;
89
    fd.desc.f = pollset->wakeup_pipe[0];
90
    fd.desc.f = pollset->wakeup_pipe[0];
91
92
    APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[0]->filedes);
93
    APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[1]->filedes);
94
90
    /* Add the pipe to the pollset
95
    /* Add the pipe to the pollset
91
     */
96
     */
92
    return apr_pollset_add(pollset, &fd);
97
    return apr_pollset_add(pollset, &fd);
93
}
98
}
94
#endif /* !APR_FILES_AS_SOCKETS */
99
#endif /* !APR_FILES_AS_SOCKETS */
95
100
96
/* Read and discard what's ever in the wakeup pipe.
101
/* Read and discard what's ever in the wakeup pipe.
97
 */
102
 */
98
void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset)
103
void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset)
99
{
104
{
(-)a/poll/unix/port.c (-1 / +6 lines)
Lines 15-34 Link Here
15
 */
15
 */
16
16
17
#include "apr.h"
17
#include "apr.h"
18
#include "apr_poll.h"
18
#include "apr_poll.h"
19
#include "apr_time.h"
19
#include "apr_time.h"
20
#include "apr_portable.h"
20
#include "apr_portable.h"
21
#include "apr_atomic.h"
21
#include "apr_atomic.h"
22
#include "apr_arch_file_io.h"
22
#include "apr_arch_file_io.h"
23
#include "apr_arch_networkio.h"
23
#include "apr_arch_networkio.h"
24
#include "apr_arch_poll_private.h"
24
#include "apr_arch_poll_private.h"
25
#include "apr_arch_inherit.h"
25
26
26
#if defined(HAVE_PORT_CREATE)
27
#if defined(HAVE_PORT_CREATE)
27
28
28
static apr_int16_t get_event(apr_int16_t event)
29
static apr_int16_t get_event(apr_int16_t event)
29
{
30
{
30
    apr_int16_t rv = 0;
31
    apr_int16_t rv = 0;
31
32
32
    if (event & APR_POLLIN)
33
    if (event & APR_POLLIN)
33
        rv |= POLLIN;
34
        rv |= POLLIN;
34
    if (event & APR_POLLPRI)
35
    if (event & APR_POLLPRI)
Lines 118-137 static apr_status_t impl_pollset_create(apr_pollset_t *pollset, Link Here
118
119
119
    pollset->p->port_set = apr_palloc(p, size * sizeof(port_event_t));
120
    pollset->p->port_set = apr_palloc(p, size * sizeof(port_event_t));
120
121
121
    pollset->p->port_fd = port_create();
122
    pollset->p->port_fd = port_create();
122
123
123
    if (pollset->p->port_fd < 0) {
124
    if (pollset->p->port_fd < 0) {
124
        pollset->p = NULL;
125
        pollset->p = NULL;
125
        return APR_ENOMEM;
126
        return APR_ENOMEM;
126
    }
127
    }
127
128
129
    APR_SET_FD_CLOEXEC(pollset->p->port_fd);
130
128
    pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
131
    pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
129
132
130
    APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link);
133
    APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link);
131
    APR_RING_INIT(&pollset->p->add_ring, pfd_elem_t, link);
134
    APR_RING_INIT(&pollset->p->add_ring, pfd_elem_t, link);
132
    APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link);
135
    APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link);
133
    APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link);
136
    APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link);
134
137
135
    return rv;
138
    return rv;
136
}
139
}
137
140
Lines 388-409 static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, Link Here
388
                                       apr_uint32_t size,
391
                                       apr_uint32_t size,
389
                                       apr_pool_t *p,
392
                                       apr_pool_t *p,
390
                                       apr_uint32_t flags)
393
                                       apr_uint32_t flags)
391
{
394
{
392
    pollcb->fd = port_create();
395
    pollcb->fd = port_create();
393
396
394
    if (pollcb->fd < 0) {
397
    if (pollcb->fd < 0) {
395
        return apr_get_netos_error();
398
        return apr_get_netos_error();
396
    }
399
    }
397
400
401
    APR_SET_FD_CLOEXEC(fd);
402
398
    pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t));
403
    pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t));
399
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup);
404
    apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null);
400
405
401
    return APR_SUCCESS;
406
    return APR_SUCCESS;
402
}
407
}
403
408
404
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
409
static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
405
                                    apr_pollfd_t *descriptor)
410
                                    apr_pollfd_t *descriptor)
406
{
411
{
407
    int ret, fd;
412
    int ret, fd;
408
413
409
    if (descriptor->desc_type == APR_POLL_SOCKET) {
414
    if (descriptor->desc_type == APR_POLL_SOCKET) {

Return to bug 46425