Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 17553 invoked from network); 6 Nov 2007 03:14:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2007 03:14:07 -0000 Received: (qmail 30939 invoked by uid 500); 6 Nov 2007 03:13:55 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 30900 invoked by uid 500); 6 Nov 2007 03:13:55 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 30889 invoked by uid 99); 6 Nov 2007 03:13:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 19:13:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 03:14:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CCD1E1A9832; Mon, 5 Nov 2007 19:13:43 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071106031343.CCD1E1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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