apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1806603 - /apr/apr/trunk/file_io/win32/readwrite.c
Date Tue, 29 Aug 2017 14:59:12 GMT
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;
+            }
             if (thefile->append) {
                 apr_file_unlock(thefile);
                 apr_thread_mutex_unlock(thefile->mutex);
@@ -453,9 +456,6 @@ APR_DECLARE(apr_status_t) apr_file_write
                 }
             }
         }
-        if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe)
{
-            thefile->filePtr += *nbytes;
-        }
     }
     return rv;
 }



Mime
View raw message