bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cvs error pruning empty directories in AFS (and SMB?) under WinXPPro


From: Ken Raeburn
Subject: cvs error pruning empty directories in AFS (and SMB?) under WinXPPro
Date: Tue, 20 Apr 2004 19:07:11 -0400

I've been having problems with CVS pruning empty directories when I do
checkouts or updates in AFS under Windows XP Pro.  (Asanka has
reproduced the problem in SMB, so it's not likely to be an AFS bug
specifically.)  I'm using (a local fork of) cvs-1.11, but from a
glance at the sources, I think the problem is still present in the
current CVS development source on cvshome.org.

I have "-P" in my checkout and update options in ~/.cvsrc.  When I
check out trees, I get errors saying that some directories cannot be
removed because they are not empty.  These are directories that I know
are not supposed to have any contents (aside from the CVS admin
files).

I finally got a chance to track it down today.

Comments in the CVS sources (in windows-NT/filesubr.c) indicate that
unlink() on a directory will return EACCES on NT or ENOENT on 95.  On
XP Pro, in AFS, with a non-empty directory, the error code actually
appears to be ENOTEMPTY.

I changed unlink_file_dir to use:

    if (unlink (f) != 0)
    {
        /* under Windows NT, unlink returns EACCES if the path
           is a directory.  Under Windows 95, ENOENT.  */
      if (errno == EISDIR || errno == EACCES || errno == ENOENT || errno == 
ENOTEMPTY)

and deep_remove_dir to use:

            if (unlink (buf) != 0 )
            {
                /* Under Windows NT, unlink returns EACCES if the path
                   is a directory.  Under Windows 95, ENOENT.  It
                   isn't really clear to me whether checking errno is
                   better or worse than using _stat to check for a directory.
                   We aren't really trying to prevent race conditions here
                   (e.g. what if something changes between readdir and
                   unlink?)  */
                if (errno == EISDIR || errno == EACCES || errno == ENOENT || 
errno == ENOTEMPTY)

Sorry, this isn't a convenient setup for diffs, but that should be
plenty of context.  (The comments should be updated appropriately
too.)

With these changes, checkout and update with pruning seem to work
fine.

Ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]