Skip to content

Commit 08a7f51

Browse files
committed
fix misuse of autodata in initialization of the wakeup
pipe when the pollset was created with APR_POLLSET_NOCOPY Submitted by: Neil Conway <nrc cs.berkeley.edu> Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@932585 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8aec4da commit 08a7f51

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/arch/unix/apr_arch_poll_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ struct apr_pollset_t
115115
apr_uint32_t flags;
116116
/* Pipe descriptors used for wakeup */
117117
apr_file_t *wakeup_pipe[2];
118+
apr_pollfd_t wakeup_pfd;
118119
apr_pollset_private_t *p;
119120
apr_pollset_provider_t *provider;
120121
};

poll/unix/pollset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,14 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset,
153153
pollset->provider = provider;
154154
}
155155
if (flags & APR_POLLSET_WAKEABLE) {
156-
apr_pollfd_t pfd;
157-
158156
/* Create wakeup pipe */
159-
if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pfd,
157+
if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pollset->wakeup_pfd,
160158
pollset->wakeup_pipe))
161159
!= APR_SUCCESS) {
162160
return rv;
163161
}
164162

165-
if ((rv = apr_pollset_add(pollset, &pfd)) != APR_SUCCESS) {
163+
if ((rv = apr_pollset_add(pollset, &pollset->wakeup_pfd)) != APR_SUCCESS) {
166164
return rv;
167165
}
168166
}

0 commit comments

Comments
 (0)