apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r592235 - in /apr/apr/trunk: include/apr_file_io.h include/apr_shm.h test/testshm.c
Date Tue, 06 Nov 2007 03:13:43 GMT
Author: wrowe
Date: Mon Nov  5 19:13:42 2007
New Revision: 592235

URL: http://svn.apache.org/viewvc?rev=592235&view=rev
Log:
Axe another poor illustration, apr_shm_destroy preceeds apr_shm_remove
for portability.  (As the comment hints, a non-portable alternative
does exist).

And be consistent in the use of @remark's --- although I suspect
that we need  to review @remarks and transition many to @warning.


Modified:
    apr/apr/trunk/include/apr_file_io.h
    apr/apr/trunk/include/apr_shm.h
    apr/apr/trunk/test/testshm.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=592235&r1=592234&r2=592235&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_file_io.h (original)
+++ apr/apr/trunk/include/apr_file_io.h Mon Nov  5 19:13:42 2007
@@ -834,7 +834,7 @@
  * 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
+ * @remark 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/include/apr_shm.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_shm.h?rev=592235&r1=592234&r2=592235&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_shm.h (original)
+++ apr/apr/trunk/include/apr_shm.h Mon Nov  5 19:13:42 2007
@@ -71,13 +71,14 @@
                                          apr_pool_t *pool);
 
 /**
- * Remove shared memory segment associated with a filename.
+ * Remove file associated with a shared memory segment.
  * @param filename The filename associated with shared-memory segment which
  *        needs to be removed
  * @param pool The pool used for file operations
  * @remark This function is only supported on platforms which support
  * name-based shared memory segments, and will return APR_ENOTIMPL on
- * platforms without such support.
+ * platforms without such support.  Removing the file while the shm
+ * is in use (prior to apr_shm_destroy) is non-portable.
  */
 APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
                                          apr_pool_t *pool);

Modified: apr/apr/trunk/test/testshm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testshm.c?rev=592235&r1=592234&r2=592235&view=diff
==============================================================================
--- apr/apr/trunk/test/testshm.c (original)
+++ apr/apr/trunk/test/testshm.c Mon Nov  5 19:13:42 2007
@@ -232,12 +232,6 @@
     }
     ABTS_PTR_NOTNULL(tc, shm);
 
-    rv = apr_shm_remove(SHARED_FILENAME, p);
-    APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
-    if (rv != APR_SUCCESS) {
-        return ;
-    }
-
     rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
     APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
     if (rv != APR_SUCCESS) {
@@ -247,6 +241,9 @@
 
     rv = apr_shm_destroy(shm);
     APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
+
+    rv = apr_shm_remove(SHARED_FILENAME, p);
+    APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
 }
 
 #endif



Mime
View raw message