diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-11-06 00:50:41 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-11-06 00:50:41 +0000 |
commit | c3054d68b422b6aa497dd24cc1094efbfff1bab7 (patch) | |
tree | c15fde8b7507444eb293827ab06ede7db855be9a | |
parent | 5fda43d1856f7416d6dbb8496c3d351842206440 (diff) | |
download | apr-c3054d68b422b6aa497dd24cc1094efbfff1bab7.tar.gz |
It is entirely pointless to have nonportable behaviors as examples
to end users of the library. Good point, however, for an @tip.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592215 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/apr_file_io.h | 2 | ||||
-rw-r--r-- | test/testdir.c | 13 |
2 files changed, 3 insertions, 12 deletions
diff --git a/include/apr_file_io.h b/include/apr_file_io.h index e37f95890..a78f5b947 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -834,6 +834,8 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, * 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); diff --git a/test/testdir.c b/test/testdir.c index 82f145d6f..7cdc4bbff 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -234,20 +234,9 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data) 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)); } |