diff options
author | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2004-05-22 07:26:10 +0000 |
---|---|---|
committer | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2004-05-22 07:26:10 +0000 |
commit | f4a39f8e4cd8aaa4a7b05bd8f8f85ab4ee13d414 (patch) | |
tree | 4c9c5ba3b4b68aaa09f14e14c6d74b111e7bcb73 /file_io | |
parent | 217cc9925c6fef05f8056890bc0df9d255b9ead5 (diff) | |
download | libapr-f4a39f8e4cd8aaa4a7b05bd8f8f85ab4ee13d414.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/trunk@65111 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 e32b2906c..cafdf4f1b 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)); |