[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] use WIN32_RETRY_LOOP also for cygwin

From: Mathias Weinert <mathias.weinert_at_gfa-net.de>
Date: 2006-05-04 18:13:51 CEST

Mathias Weinert wrote:
> In libsvn_subr/io.c there is macro called WIN32_RETRY_LOOP used to do
> several retries of some file commands like rename. As the problem which
> this macro shall solve - or at least soothe - also exists under cygwin
> I would like this macro to also be used if under cygwin.
>
> The following patch is just quick and dirty (indeed it's very dirty)
> but it shows what I mean (and it works and helps).
>
> Are there any objections against such a change (in principal)?

After doing some more tests I found out that in my cygwin environment
the rename failed several times with an error code of 13 which is
ERROR_INVALID_DATA. After adding this error to the WIN32_RETRY_LOOP
macro it worked without any problems.

So here is a new version of the patch (which is at least not as dirty
as the last one ;-) ). Maybe the ERROR_INVALID_DATA only applies for
cygwin. In that case two separate macros should be defined.

Mathias

--- subversion/libsvn_subr/io.c.orig 2005-11-17 00:05:43.000000000 +0100
+++ subversion/libsvn_subr/io.c 2006-05-04 16:21:12.701822100 +0200
@@ -30,6 +30,9 @@
 #include <errno.h>
 #endif
 #endif
+#ifdef CYGWIN
+#include <winerror.h>
+#endif
 
 #ifndef APR_STATUS_IS_EPERM
 #ifdef EPERM
@@ -71,7 +74,7 @@
   goes a long way towards minimizing it. It is not an infinite
   loop because there might really be an error.
 */
-#ifdef WIN32
+#if defined(WIN32) | defined(CYGWIN)
 #define WIN32_RETRY_LOOP(err, expr) \
   do \
     { \
@@ -80,6 +83,7 @@
       int retries; \
       for (retries = 0; \
            retries < 100 && (os_err == ERROR_ACCESS_DENIED \
+ || os_err == ERROR_INVALID_DATA \
                              || os_err == ERROR_SHARING_VIOLATION); \
            ++retries, os_err = APR_TO_OS_ERROR (err)) \
         { \

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 4 18:14:25 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.