delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/10/01:22:29

From: noer AT cygnus DOT com (Geoffrey Noer)
Subject: Re: error code fix for rmdir under win95/98
10 Sep 1998 01:22:29 -0700 :
Message-ID: <19980910004811.21668.cygnus.cygwin32.developers@cygnus.com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19980816194416 DOT 007ee890 AT mail DOT mel DOT cybec DOT com DOT au>
Mime-Version: 1.0
To: Trevor Yann <TYann AT vet DOT com DOT au>
Cc: cygwin32-developers AT cygnus DOT com

Thanks, this patch has been applied...
-gjn

On Sun, Aug 16, 1998 at 07:44:16PM +1000, Trevor Yann wrote:
>
> An attempt to remove a non-empty directory is reported differently under NT
> than it is under Windows 95/98. NT correctly returns the error
> DIR_NOT_EMPTY, but both Windows 95 and Windows 98 return
> ERROR_ACCESS_DENIED. This fix allows a correct error code to be returned.
> 
> dir.cc	(rmdir): return correct error code when attempting to remove a
> non-empty directory under windows 95/98
> 
> diff -ur winsup.original/dir.cc winsup/dir.cc
> --- winsup.original/dir.cc	Tue Jun 02 04:21:12 1998
> +++ winsup/dir.cc	Fri Aug 14 22:27:56 1998
> @@ -294,6 +294,12 @@
>  
>    if (RemoveDirectoryA (real_dir.get_win32 ()))
>      res = 0;
> +  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);
> +    }
>    else
>      __seterrno ();
>  

-- 
Geoffrey Noer
noer AT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019