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

Re: [libsvn_fs_fs] 'Directory not empty' error when removing committed txn

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2004-05-09 14:08:24 CEST

Josh Pieper wrote:

> Garrett Rooney wrote:
>
>>No, this is on Mac OS X. And on windows the error we get back is about
>>access denied, not about the directory not being empty.
>
>
> Do you think it could a symptom of the problem described here?
>
> http://www.mail-archive.com/bug-fileutils@gnu.org/msg02337.html

That seems likely. Apparently the workaround is to call 'rewinddir'
after removing an entry from the directory. Sure enough, the following
hack to io.c seems to work around the problem.

It seems that a work around for the problem should probably be added to
APR, although I imagine we might want to include one in Subversion as
well for now, so that people are not forced to upgrade.

-garrett

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 9658)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1175,16 +1175,30 @@
           
           if (this_entry.filetype == APR_DIR)
             {
+ apr_status_t apr_err;
+
               SVN_ERR (svn_io_remove_dir (fullpath, subpool));
+
+ apr_err = apr_dir_rewind (this_dir);
+ if (apr_err)
+ return svn_error_wrap_apr (apr_err,
+ "Can't rewind directory '%s'", path);
             }
           else if (this_entry.filetype == APR_REG)
             {
+ apr_status_t apr_err;
+
               /* ### Do we really need the check for APR_REG here? Shouldn't
                  we remove symlinks, pipes and whatnot, too? --xbc */
               svn_error_t *err = svn_io_remove_file (fullpath, subpool);
               if (err)
                 return svn_error_createf (err->apr_err, err,
                                           "Can't remove '%s'", fullpath);
+
+ apr_err = apr_dir_rewind (this_dir);
+ if (apr_err)
+ return svn_error_wrap_apr (apr_err,
+ "Can't rewind directory '%s'", path);
             }
         }
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun May 9 14:08:40 2004

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.