summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Havard <bjh@apache.org>2004-05-22 07:28:57 +0000
committerBrian Havard <bjh@apache.org>2004-05-22 07:28:57 +0000
commit8ad904666004067c834272716e66ee59f2f076b1 (patch)
tree66ab6fb99f2976dc34afc9d7499cafd76fb36697
parenta38644e0009da6feaf4b7efc55adee83baf294c5 (diff)
downloadapr-8ad904666004067c834272716e66ee59f2f076b1.tar.gz
OS/2: In apr_file_info_get(), flush any unwritten buffered data before querying
the file's details to ensure the file size is correct. This matches the behaviour of the unix implementation & make subversion happy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65112 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/os2/filestat.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
index 2912e5676..80f5b00e0 100644
--- a/file_io/os2/filestat.c
+++ b/file_io/os2/filestat.c
@@ -91,8 +91,17 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want
ULONG rc;
FILESTATUS3 fstatus;
- if (thefile->isopen)
+ if (thefile->isopen) {
+ if (thefile->buffered) {
+ apr_status_t rv = apr_file_flush(thefile);
+
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
+ }
+
rc = DosQueryFileInfo(thefile->filedes, FIL_STANDARD, &fstatus, sizeof(fstatus));
+ }
else
rc = DosQueryPathInfo(thefile->fname, FIL_STANDARD, &fstatus, sizeof(fstatus));