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

[PATCH] Better workaround for systems with broken readdir

From: Artem Egorkine <arteme_at_gmail.com>
Date: 2006-07-05 17:31:40 CEST

Hi,

I can now confirm that readdir() of FreeBSD-6.1RC is broken just like
that of MacOS X, see
http://subversion.tigris.org/issues/show_bug.cgi?id=1896 for more
discussion.

Forcefuly applying the MacOS workaround as described in that issue
fixes the problem on FreeBSD. The problem with the workaround is that
a call to rewinddir() after deleting every file makes
svn_io_remove_dir() quite slow.

As I proposed in http://svn.haxx.se/dev/archive-2006-06/0694.shtml
thread, here is in my oppinion a better solution:

  1. readdir()
 2. if there's nothing to delete, we're done
 3. delete everything
  4. rewinddir()
  5. goto 1

Please find a patch attached that does exactly that. It is
unconditional of MacOS or FreeBSD. The overhead on an OS without the
bug is one rewinddir() and two readdir()s, which is not much. The
benefit, however, is that we'll never have to face the problem ever
again even when we encounter other systems that a similar problem is
found on.

[[[
Rewind directory after something has been deleted from it to work around
operating systems with broken readdir that may skip files in such
circumstances.

* subversion/libsvn_subr/io.c
  (svn_io_remove_dir): Rewind directory after something has been deleted.
]]]

Regards,
  Artem Egorkine

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Wed Jul 5 17:36:37 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.