diff options
author | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2004-05-22 07:28:57 +0000 |
---|---|---|
committer | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2004-05-22 07:28:57 +0000 |
commit | 8713a76df7315739b941a4c9a303cf7a7ca42f87 (patch) | |
tree | 66ab6fb99f2976dc34afc9d7499cafd76fb36697 /file_io | |
parent | 791c0c6d88857214215c8f67fb9e19bf02584195 (diff) | |
download | libapr-8713a76df7315739b941a4c9a303cf7a7ca42f87.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: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65112 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/os2/filestat.c | 11 |
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)); |