This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: [nielm@bigfoot.com: cygwin 1.5.7: rmdir of cwd with open file crashes process]
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 12 Mar 2004 20:36:14 -0500
- Subject: Re: [nielm@bigfoot.com: cygwin 1.5.7: rmdir of cwd with open file crashes process]
At 02:41 PM 3/12/2004 -0500, Christopher Faylor wrote:
>Anyone have time to look into this?
Infinite recursion of rmdir.
After a failure the idea is to chdir to c:\ and to delete the directory
ONCE again by calling rmdir, but SetCurrentDirectory does not update
cygheap->cwd.win32, so ...
An obvious fix is to replace of call to rmdir by a call to
RemoveDirectory (real_dir), but that looks too simple.
I don't see much in the ChangeLog. Any other suggestion?
Pierre
if (strcasematch (real_dir, cygheap->cwd.win32)
&& !strcasematch ("c:\\", cygheap->cwd.win32))
{
DWORD err = GetLastError ();
if (!SetCurrentDirectory ("c:\\"))
SetLastError (err);
else if ((res = rmdir (dir)))
SetCurrentDirectory (cygheap->cwd.win32);
}