This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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);
	    }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]