summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2013-10-12 18:04:28 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2013-10-12 18:04:28 +0000
commit204963b4d62565aaac32496f3f9d83cba3a32d51 (patch)
tree306a126bf4d4677645fec37a182660a74035a5eb /file_io
parentd88246950cccffec8cfa4f1015a7853f6e8e24d7 (diff)
downloadlibapr-204963b4d62565aaac32496f3f9d83cba3a32d51.tar.gz
Merge r748080:
On windows files != sockets, so do not create unneeded pollset for every opened file. Submitted by: mturk git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1531565 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/win32/filedup.c6
-rw-r--r--file_io/win32/open.c6
-rw-r--r--file_io/win32/pipe.c9
3 files changed, 14 insertions, 7 deletions
diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
index 553228e3f..058e0e6cb 100644
--- a/file_io/win32/filedup.c
+++ b/file_io/win32/filedup.c
@@ -57,10 +57,11 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup,
apr_pool_cleanup_null);
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0);
-
+#endif
return APR_SUCCESS;
#endif /* !defined(_WIN32_WCE) */
}
@@ -216,9 +217,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
apr_pool_cleanup_kill(old_file->pool, (void *)old_file,
file_cleanup);
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0);
-
+#endif
return APR_SUCCESS;
}
diff --git a/file_io/win32/open.c b/file_io/win32/open.c
index f5f32f34b..d2921a7a8 100644
--- a/file_io/win32/open.c
+++ b/file_io/win32/open.c
@@ -475,10 +475,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
/* This feature is not supported on this platform. */
(*new)->flags &= ~APR_FOPEN_SPARSE;
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new)->pollset, 1, pool, 0);
-
+#endif
if (!(flag & APR_FOPEN_NOCLEANUP)) {
apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup,
apr_pool_cleanup_null);
@@ -654,10 +655,11 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file,
}
}
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*file)->pollset, 1, pool, 0);
-
+#endif
/* Should we be testing if thefile is a handle to
* a PIPE and set up the mechanics appropriately?
*
diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
index 9344c7ae1..79138e7f5 100644
--- a/file_io/win32/pipe.c
+++ b/file_io/win32/pipe.c
@@ -107,8 +107,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
(*in)->dataRead = 0;
(*in)->direction = 0;
(*in)->pOverlapped = NULL;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*in)->pollset, 1, p, 0);
-
+#endif
(*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
(*out)->pool = p;
(*out)->fname = NULL;
@@ -121,8 +122,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
(*out)->dataRead = 0;
(*out)->direction = 0;
(*out)->pOverlapped = NULL;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*out)->pollset, 1, p, 0);
-
+#endif
if (apr_os_level >= APR_WIN_NT) {
/* Create the read end of the pipe */
dwOpenMode = PIPE_ACCESS_INBOUND;
@@ -210,8 +212,9 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file,
(*file)->timeout = -1;
(*file)->ungetchar = -1;
(*file)->filehand = *thefile;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*file)->pollset, 1, pool, 0);
-
+#endif
if (register_cleanup) {
apr_pool_cleanup_register(pool, *file, file_cleanup,
apr_pool_cleanup_null);