summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrane <brane@13f79535-47bb-0310-9956-ffa450edef68>2003-03-07 19:21:29 +0000
committerbrane <brane@13f79535-47bb-0310-9956-ffa450edef68>2003-03-07 19:21:29 +0000
commit73fe6c77b8aed24cfc4be42bf8a4d2ae8e127f9c (patch)
tree107c07b76db7a050971c148e68d1b8f75e566c73
parent24f4b0b5a5284371f4aa99576965981fc6fedf63 (diff)
downloadlibapr-73fe6c77b8aed24cfc4be42bf8a4d2ae8e127f9c.tar.gz
Fix the 'test_buffered_write_size' test by ensuring that buffered
files are flushed before calling fstat. [Port of jorton's rev. 1.65 commit of apr/file_io/unix/filestat.c] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64409 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/win32/filestat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
index a7f922d9c..f94417106 100644
--- a/file_io/win32/filestat.c
+++ b/file_io/win32/filestat.c
@@ -411,6 +411,12 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want
{
BY_HANDLE_FILE_INFORMATION FileInfo;
+ if (thefile->buffered) {
+ apr_status_t rv = apr_file_flush(thefile);
+ if (rv != APR_SUCCESS)
+ return rv;
+ }
+
if (!GetFileInformationByHandle(thefile->filehand, &FileInfo)) {
return apr_get_os_error();
}