apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r592216 - in /apr/apr/branches/1.2.x: include/apr_file_io.h test/testdir.c
Date Tue, 06 Nov 2007 00:51:23 GMT
Author: wrowe
Date: Mon Nov  5 16:51:20 2007
New Revision: 592216

URL: http://svn.apache.org/viewvc?rev=592216&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.

Backports: 592215

Modified:
    apr/apr/branches/1.2.x/include/apr_file_io.h
    apr/apr/branches/1.2.x/test/testdir.c

Modified: apr/apr/branches/1.2.x/include/apr_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr_file_io.h?rev=592216&r1=592215&r2=592216&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/include/apr_file_io.h (original)
+++ apr/apr/branches/1.2.x/include/apr_file_io.h Mon Nov  5 16:51:20 2007
@@ -724,6 +724,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/branches/1.2.x/test/testdir.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/testdir.c?rev=592216&r1=592215&r2=592216&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testdir.c (original)
+++ apr/apr/branches/1.2.x/test/testdir.c Mon Nov  5 16:51:20 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));
 }
 
 



Mime
View raw message