apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject RE: [PATCH] Support APR_APPEND (O_APPEND) with apr_file_write on Windows
Date Fri, 25 Oct 2002 17:21:13 GMT
On Fri, 25 Oct 2002, Bill Stoddard wrote:

> 
> > At 09:27 AM 10/25/2002, Bill Stoddard wrote:
> > >The only problem with this patch [...]
> > >
> > >--- readwrite.c 19 Sep 2002 12:20:20 -0000      1.1.1.1
> > >+++ readwrite.c 25 Oct 2002 13:44:53 -0000
> > >-        if (thefile->pOverlapped && !thefile->pipe) {
> > >-            thefile->pOverlapped->Offset     = (DWORD)thefile->filePtr;
> > >-            thefile->pOverlapped->OffsetHigh =
> > (DWORD)(thefile->filePtr >>
> > >32);
> > >-        }
> > >-        else if (!thefile->pipe && thefile->append) {
> > >+        if (thefile->append && !thefile->pipe) {
> > >+            int rc;
> > >+            rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE);
> > >+            if (rc != APR_SUCCESS) {
> > >+                rc = APR_SUCCESS;
> > >+            }
> > >             SetFilePointer(thefile->filehand, 0, NULL, FILE_END);
> >
> > You can't just drop the Overlapped test.  there is NO CURRENT POSITION
> > if you have opened a file for overlapped I/O.
> 
> I know. Overlapped is not used when writing to the access log.

But you are writing code for APR here, not Apache.  You can't gaurantee
that nobody will try to use Overlapped with APPEND.

Ryan
_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
550 Jean St
Oakland CA 94610
-------------------------------------------------------------------------------


Mime
View raw message