apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@rkbloom.net>
Subject Re: EEXIST from apr_dir_remove
Date Fri, 15 Nov 2002 19:50:31 GMT

I am torn about this.  On the one hand, a simple single test for this
condition is useful.  However, EEXIST and ENOTEMPTY just don't sound like
the same thing, so having one macro that checks for both doesn't make
sense.  Does anybody have a strong opinion one way or the other?

Ryan

On Fri, 15 Nov 2002, Joe Orton wrote:

> On some platforms rmdir(2) fails with EEXIST rather than ENOTEMPTY when
> trying to delete a non-empty directory; in fact POSIX specifies that
> both EEXIST and ENOTEMPTY are allowed for this case.
>
> The test_removeall_fail() test uses APR_STATUS_IS_ENOTEMPTY() for this
> case. Is it okay to extend APR_STATUS_IS_ENOTEMPTY to return true for
> EEXIST for this case (as below), or should the test be changed?
>
> --- include/apr_errno.h	10 Nov 2002 08:35:16 -0000	1.101
> +++ include/apr_errno.h	15 Nov 2002 14:02:55 -0000
> @@ -1202,7 +1202,8 @@
>  /** cross device link */
>  #define APR_STATUS_IS_EXDEV(s)           ((s) == APR_EXDEV)
>  /** Directory Not Empty */
> -#define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY)
> +#define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY \
> +                                          (s) == APR_EEXIST)
>
>  #endif /* !def OS2 || WIN32 */
>
>


Mime
View raw message