wrowe 2002/10/28 18:19:50
Modified: file_io/win32 readwrite.c
Log:
If opened append and overlapped, use apr_file_seek -first- to recompute
->filePtr.
Revision Changes Path
1.71 +4 -4 apr/file_io/win32/readwrite.c
Index: readwrite.c
===================================================================
RCS file: /home/cvs/apr/file_io/win32/readwrite.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- readwrite.c 29 Oct 2002 01:28:32 -0000 1.70
+++ readwrite.c 29 Oct 2002 02:19:50 -0000 1.71
@@ -306,10 +306,6 @@
if (!thefile->pipe) {
apr_off_t offset = 0;
apr_status_t rc;
- if (thefile->pOverlapped) {
- thefile->pOverlapped->Offset = (DWORD)thefile->filePtr;
- thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr
>> 32);
- }
if (thefile->append) {
apr_thread_mutex_lock(thefile->mutex);
if (!thefile->pOverlapped) {
@@ -324,6 +320,10 @@
apr_thread_mutex_unlock(thefile->mutex);
return rc;
}
+ }
+ if (thefile->pOverlapped) {
+ thefile->pOverlapped->Offset = (DWORD)thefile->filePtr;
+ thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr
>> 32);
}
rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote,
thefile->pOverlapped);