apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Huijben" <b...@qqmail.nl>
Subject RE: svn commit: r1806603 - /apr/apr/trunk/file_io/win32/readwrite.c
Date Wed, 30 Aug 2017 10:28:00 GMT


> -----Original Message-----
> From: ivan@apache.org [mailto:ivan@apache.org]
> Sent: dinsdag 29 augustus 2017 16:59
> To: commits@apr.apache.org
> 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


Mime
View raw message