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 */
