diff options
author | Paul Querna <pquerna@apache.org> | 2007-02-28 18:05:37 +0000 |
---|---|---|
committer | Paul Querna <pquerna@apache.org> | 2007-02-28 18:05:37 +0000 |
commit | f2cc92c2ecb75c88cae110b5ccf16cf3d467befb (patch) | |
tree | ce6297b0e38c56a6b7097dd2a51899bb63b050d0 /file_io/unix | |
parent | ea6ca1735d8261e5956b455844de2ea126bb0d3e (diff) | |
download | apr-f2cc92c2ecb75c88cae110b5ccf16cf3d467befb.tar.gz apr-f2cc92c2ecb75c88cae110b5ccf16cf3d467befb.zip |
Fix apr_file_writev when buffering is enabled by forcing a flush, rather than writing underneath the write buffer.
PR: 41197
Submitted By: Davi Arnaut
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@512882 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix')
-rw-r--r-- | file_io/unix/readwrite.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 320735d68..56d9bfff6 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -239,6 +239,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + #ifdef HAVE_WRITEV apr_ssize_t bytes; |