bjh 2004/05/22 00:26:11
Modified: file_io/os2 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
1.41 +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.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- filestat.c 13 Feb 2004 09:38:24 -0000 1.40
+++ filestat.c 22 May 2004 07:26:10 -0000 1.41
@@ -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));