> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: dinsdag 29 augustus 2017 16:59
> To: [email protected]
> Subject: svn commit: r1806603 - /apr/apr/trunk/file_io/win32/readwrite.c
>
> Author: ivan
> Date: Tue Aug 29 14:59:11 2017
> New Revision: 1806603
>
> URL: http://svn.apache.org/viewvc?rev=1806603&view=rev
> Log:
> Minor refactoring of the Win32 file write code.
>
> * file_io/win32/readwrite.c
> (apr_file_write): Update filePtr in the asynchronous I/O mode after
> the WriteFile() call. This allows simplifying the condition by not
> checking for thefile->pipe property.
>
> Patch by: Evgeny Kotkov <evgeny.kotkov {at} visualsvn.com>
>
> Modified:
> apr/apr/trunk/file_io/win32/readwrite.c
>
> Modified: apr/apr/trunk/file_io/win32/readwrite.c
> URL:
> http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/readwrite.c?rev
> =1806603&r1=1806602&r2=1806603&view=diff
> ==========================================================
> ====================
> --- apr/apr/trunk/file_io/win32/readwrite.c (original)
> +++ apr/apr/trunk/file_io/win32/readwrite.c Tue Aug 29 14:59:11 2017
> @@ -398,6 +398,9 @@ APR_DECLARE(apr_status_t) apr_file_write
> }
> rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote,
> thefile->pOverlapped);
> + if (rv == APR_SUCCESS && thefile->pOverlapped) {
> + thefile->filePtr += *nbytes;
> + }
The result of WriteFile should not be checked against APR_SUCCESS, as that is
not a documented Windows result code. The right constant evaluating to 0 should
be used.
Bert