On Mon, Feb 03, 2003 at 11:51:56PM -0000, Branko ïibej wrote:
> brane 2003/02/03 15:51:56
>
> Modified: test testfileinfo.c
> Log:
> Added a new test to check the behaviour of apr_file_info_get in
> combination with buffered writes. At the moment, this test will
> probably fail on all plaforms.
It does indeed, is this the kind of fix you were thinking of?
Index: filestat.c
===================================================================
RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
retrieving revision 1.64
diff -u -r1.64 filestat.c
--- filestat.c 7 Jan 2003 00:52:53 -0000 1.64
+++ filestat.c 7 Feb 2003 12:36:01 -0000
@@ -131,6 +131,13 @@
{
struct stat info;
+ if (thefile->buffered) {
+ apr_status_t rv = apr_file_flush(thefile);
+
+ if (rv != APR_SUCCESS)
+ return rv;
+ }
+
if (fstat(thefile->filedes, &info) == 0) {
finfo->pool = thefile->pool;
finfo->fname = thefile->fname;