public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* PATCH for winsup/dir.cc
@ 1999-09-14 11:47 Guy Maor
  1999-09-30 23:42 ` Guy Maor
  0 siblings, 1 reply; 2+ messages in thread
From: Guy Maor @ 1999-09-14 11:47 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH for winsup/dir.cc
  1999-09-14 11:47 PATCH for winsup/dir.cc Guy Maor
@ 1999-09-30 23:42 ` Guy Maor
  0 siblings, 0 replies; 2+ messages in thread
From: Guy Maor @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-14 11:47 PATCH for winsup/dir.cc Guy Maor
1999-09-30 23:42 ` Guy Maor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).