You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2010/01/22 15:08:48 UTC
svn commit: r902090 - in /apr/apr/trunk:
include/arch/unix/apr_arch_poll_private.h poll/unix/epoll.c
poll/unix/kqueue.c poll/unix/poll.c poll/unix/pollcb.c poll/unix/pollset.c
poll/unix/port.c poll/unix/select.c poll/unix/wakeup.c
Author: trawick
Date: Fri Jan 22 14:08:47 2010
New Revision: 902090
URL: http://svn.apache.org/viewvc?rev=902090&view=rev
Log:
add namespace protection for
* create_wakeup_pipe()
* close_wakeup_pipe()
* drain_wakeup_pipe()
use generic apr_poll_ since these are used from both apr_pollset_ and
apr_pollcb_
Modified:
apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h
apr/apr/trunk/poll/unix/epoll.c
apr/apr/trunk/poll/unix/kqueue.c
apr/apr/trunk/poll/unix/poll.c
apr/apr/trunk/poll/unix/pollcb.c
apr/apr/trunk/poll/unix/pollset.c
apr/apr/trunk/poll/unix/port.c
apr/apr/trunk/poll/unix/select.c
apr/apr/trunk/poll/unix/wakeup.c
Modified: apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h (original)
+++ apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h Fri Jan 22 14:08:47 2010
@@ -167,9 +167,13 @@
const char *name;
};
-/* Private functions */
-apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, apr_file_t **wakeup_pipe);
-apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe);
-void drain_wakeup_pipe(apr_file_t **wakeup_pipe);
+/*
+ * Private functions used for the implementation of both apr_pollcb_* and
+ * apr_pollset_*
+ */
+apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
+ apr_file_t **wakeup_pipe);
+apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe);
+void apr_poll_drain_wakeup_pipe(apr_file_t **wakeup_pipe);
#endif /* APR_ARCH_POLL_PRIVATE_H */
Modified: apr/apr/trunk/poll/unix/epoll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/epoll.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/epoll.c (original)
+++ apr/apr/trunk/poll/unix/epoll.c Fri Jan 22 14:08:47 2010
@@ -279,7 +279,7 @@
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
fdptr->desc_type == APR_POLL_FILE &&
fdptr->desc.f == pollset->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
}
else {
@@ -441,7 +441,7 @@
if ((pollcb->flags & APR_POLLSET_WAKEABLE) &&
pollfd->desc_type == APR_POLL_FILE &&
pollfd->desc.f == pollcb->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollcb->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);
return APR_EINTR;
}
Modified: apr/apr/trunk/poll/unix/kqueue.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/kqueue.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/kqueue.c (original)
+++ apr/apr/trunk/poll/unix/kqueue.c Fri Jan 22 14:08:47 2010
@@ -277,7 +277,7 @@
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
fd.desc_type == APR_POLL_FILE &&
fd.desc.f == pollset->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
}
else {
@@ -455,7 +455,7 @@
if ((pollcb->flags & APR_POLLSET_WAKEABLE) &&
pollfd->desc_type == APR_POLL_FILE &&
pollfd->desc.f == pollcb->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollcb->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);
return APR_EINTR;
}
Modified: apr/apr/trunk/poll/unix/poll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/poll.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/poll.c (original)
+++ apr/apr/trunk/poll/unix/poll.c Fri Jan 22 14:08:47 2010
@@ -267,7 +267,7 @@
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
pollset->p->query_set[i].desc_type == APR_POLL_FILE &&
pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
}
else {
@@ -407,7 +407,7 @@
if ((pollcb->flags & APR_POLLSET_WAKEABLE) &&
pollfd->desc_type == APR_POLL_FILE &&
pollfd->desc.f == pollcb->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollcb->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);
return APR_EINTR;
}
Modified: apr/apr/trunk/poll/unix/pollcb.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollcb.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollcb.c (original)
+++ apr/apr/trunk/poll/unix/pollcb.c Fri Jan 22 14:08:47 2010
@@ -80,7 +80,7 @@
(*pollcb->provider->cleanup)(pollcb);
}
if (pollcb->flags & APR_POLLSET_WAKEABLE) {
- close_wakeup_pipe(pollcb->wakeup_pipe);
+ apr_poll_close_wakeup_pipe(pollcb->wakeup_pipe);
}
return APR_SUCCESS;
@@ -158,8 +158,9 @@
if (flags & APR_POLLSET_WAKEABLE) {
/* Create wakeup pipe */
- if ((rv = create_wakeup_pipe(pollcb->pool, &pollcb->wakeup_pfd,
- pollcb->wakeup_pipe)) != APR_SUCCESS) {
+ if ((rv = apr_poll_create_wakeup_pipe(pollcb->pool, &pollcb->wakeup_pfd,
+ pollcb->wakeup_pipe))
+ != APR_SUCCESS) {
return rv;
}
Modified: apr/apr/trunk/poll/unix/pollset.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollset.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/pollset.c (original)
+++ apr/apr/trunk/poll/unix/pollset.c Fri Jan 22 14:08:47 2010
@@ -37,7 +37,7 @@
(*pollset->provider->cleanup)(pollset);
}
if (pollset->flags & APR_POLLSET_WAKEABLE) {
- close_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_close_wakeup_pipe(pollset->wakeup_pipe);
}
return APR_SUCCESS;
@@ -156,8 +156,9 @@
apr_pollfd_t pfd;
/* Create wakeup pipe */
- if ((rv = create_wakeup_pipe(pollset->pool, &pfd,
- pollset->wakeup_pipe)) != APR_SUCCESS) {
+ if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pfd,
+ pollset->wakeup_pipe))
+ != APR_SUCCESS) {
return rv;
}
Modified: apr/apr/trunk/poll/unix/port.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/port.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/port.c (original)
+++ apr/apr/trunk/poll/unix/port.c Fri Jan 22 14:08:47 2010
@@ -405,7 +405,7 @@
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
fp.desc_type == APR_POLL_FILE &&
fp.desc.f == pollset->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
}
else {
@@ -554,7 +554,7 @@
if ((pollcb->flags & APR_POLLSET_WAKEABLE) &&
pollfd->desc_type == APR_POLL_FILE &&
pollfd->desc.f == pollcb->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollcb->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe);
return APR_EINTR;
}
Modified: apr/apr/trunk/poll/unix/select.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/select.c (original)
+++ apr/apr/trunk/poll/unix/select.c Fri Jan 22 14:08:47 2010
@@ -382,7 +382,7 @@
else {
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) {
- drain_wakeup_pipe(pollset->wakeup_pipe);
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
continue;
}
Modified: apr/apr/trunk/poll/unix/wakeup.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/wakeup.c?rev=902090&r1=902089&r2=902090&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/wakeup.c (original)
+++ apr/apr/trunk/poll/unix/wakeup.c Fri Jan 22 14:08:47 2010
@@ -27,8 +27,8 @@
#ifdef WIN32
-apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
- apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
+ apr_file_t **wakeup_pipe)
{
apr_status_t rv;
@@ -42,7 +42,7 @@
return APR_SUCCESS;
}
-apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe)
{
apr_status_t rv0 = APR_SUCCESS;
apr_status_t rv1 = APR_SUCCESS;
@@ -61,12 +61,12 @@
#else /* !WIN32 */
-apr_status_t create_wakeup_pipe(apr_pollfd_t *pfd, apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_create_wakeup_pipe(apr_pollfd_t *pfd, apr_file_t **wakeup_pipe)
{
return APR_ENOTIMPL;
}
-apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe)
{
return APR_ENOTIMPL;
}
@@ -75,8 +75,8 @@
#else /* APR_FILES_AS_SOCKETS */
-apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
- apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd,
+ apr_file_t **wakeup_pipe)
{
apr_status_t rv;
@@ -113,7 +113,7 @@
return APR_SUCCESS;
}
-apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe)
+apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe)
{
apr_status_t rv0 = APR_SUCCESS;
apr_status_t rv1 = APR_SUCCESS;
@@ -134,7 +134,7 @@
/* Read and discard whatever is in the wakeup pipe.
*/
-void drain_wakeup_pipe(apr_file_t **wakeup_pipe)
+void apr_poll_drain_wakeup_pipe(apr_file_t **wakeup_pipe)
{
char rb[512];
apr_size_t nr = sizeof(rb);