This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
PATCH for winsup/dir.cc
- To: cygwin AT sourceware.cygnus dot com
- Subject: PATCH for winsup/dir.cc
- From: Guy Maor <gmaor AT wlv.hp dot com>
- Date: 14 Sep 1999 11:40:04 -0700
Here is a patch to winsup/dir.cc which fixes rmdir() errno codes on
Win 95/98. It's a pretty straightforward fix.
--- dir.cc.orig Tue Sep 14 11:29:36 1999
+++ dir.cc Tue Aug 31 11:20:26 1999
@@ -331,11 +300,14 @@
else if (os_being_run != winNT && GetLastError() == ERROR_ACCESS_DENIED)
{
/* Under Windows 95 & 98, ERROR_ACCESS_DENIED is returned
- if you try to remove a directory that is not empty. */
- set_errno (ENOTEMPTY);
+ if you try to remove a file or a non-empty directory. */
+ if (GetFileAttributes (real_dir.get_win32()) != FILE_ATTRIBUTE_DIRECTORY)
+ set_errno (ENOTDIR);
+ else
+ set_errno (ENOTEMPTY);
}
I'm not subscribed to the cygwin list, so please cc me on any replies.
Guy
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com