You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2003/03/06 10:21:25 UTC

cvs commit: apr/file_io/unix filestat.c

jorton      2003/03/06 01:21:25

  Modified:    file_io/unix filestat.c
  Log:
  Fix the 'test_buffered_write_size' test by ensuring that buffered
  files are flushed before calling fstat.
  
  Revision  Changes    Path
  1.65      +6 -0      apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- filestat.c	7 Jan 2003 00:52:53 -0000	1.64
  +++ filestat.c	6 Mar 2003 09:21:24 -0000	1.65
  @@ -131,6 +131,12 @@
   {
       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;