Author: wrowe
Date: Mon Nov 5 16:50:41 2007
New Revision: 592215
URL: http://svn.apache.org/viewvc?rev=592215&view=rev
Log:
It is entirely pointless to have nonportable behaviors as examples
to end users of the library. Good point, however, for an @tip.
Modified:
apr/apr/trunk/include/apr_file_io.h
apr/apr/trunk/test/testdir.c
Modified: apr/apr/trunk/include/apr_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_file_io.h?rev=592215&r1=592214&r2=592215&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_file_io.h (original)
+++ apr/apr/trunk/include/apr_file_io.h Mon Nov 5 16:50:41 2007
@@ -834,6 +834,8 @@
* Remove directory from the file system.
* @param path the path for the directory to be removed. (use / on all systems)
* @param pool the pool to use.
+ * @tip removing a directory which is in-use (e.g., the current working
+ * directory, or during apr_dir_read, or with an open file) is not portable.
*/
APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool);
Modified: apr/apr/trunk/test/testdir.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testdir.c?rev=592215&r1=592214&r2=592215&view=diff
==============================================================================
--- apr/apr/trunk/test/testdir.c (original)
+++ apr/apr/trunk/test/testdir.c Mon Nov 5 16:50:41 2007
@@ -234,20 +234,9 @@
APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p));
- rv = apr_dir_remove(path, p);
- /* Some platforms cannot remove a directory which is in use. */
- if (rv == APR_SUCCESS) {
- ABTS_ASSERT(tc, "fail to create dir",
- apr_dir_make_recursive("foobar", APR_OS_DEFAULT,
- p) != APR_SUCCESS);
- }
-
APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p));
- if (rv) {
- apr_dir_remove(path, p);
- ABTS_NOT_IMPL(tc, "cannot remove in-use directory");
- }
+ APR_ASSERT_SUCCESS(tc, "remove cwd", rv = apr_dir_remove(path, p));
}
|