bjh 2004/05/22 00:28:57
Modified: file_io/os2 Tag: APR_0_9_BRANCH filestat.c
Log:
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.
Revision Changes Path
No revision
No revision
1.37.2.2 +10 -1 apr/file_io/os2/filestat.c
Index: filestat.c
===================================================================
RCS file: /home/cvs/apr/file_io/os2/filestat.c,v
retrieving revision 1.37.2.1
retrieving revision 1.37.2.2
diff -u -r1.37.2.1 -r1.37.2.2
--- filestat.c 13 Feb 2004 09:33:42 -0000 1.37.2.1
+++ filestat.c 22 May 2004 07:28:57 -0000 1.37.2.2
@@ -91,8 +91,17 @@
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));