Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 96774 invoked by uid 500); 8 Feb 2003 01:21:21 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 96761 invoked from network); 8 Feb 2003 01:21:20 -0000 Message-ID: <3E445B98.9080104@xbc.nu> Date: Sat, 08 Feb 2003 02:21:28 +0100 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: sl, en-gb, en MIME-Version: 1.0 To: Joe Orton CC: dev@apr.apache.org Subject: Re: cvs commit: apr/test testfileinfo.c References: <20030203235156.1001.qmail@icarus.apache.org> <20030207123953.GB8610@manyfish.co.uk> In-Reply-To: <20030207123953.GB8610@manyfish.co.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Joe Orton wrote: >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? > I expect that change would avoid the problem, yes. (In fact, in Subversion, I did an explicit fluxh befode calling apr_file_info_get, for this very reason.) I was sort of hoping someone had a better idea for a fix, though; forcing a flush before every stat seems to me to defeat the whole purpose of buffering. >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; > > -- Brane Čibej http://www.xbc.nu/brane/