Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 61793 invoked by uid 500); 1 Oct 2001 18:32:20 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 61727 invoked from network); 1 Oct 2001 18:32:19 -0000 Date: Mon, 1 Oct 2001 14:32:08 -0400 (EDT) From: Cliff Woolley X-X-Sender: To: Subject: apr_file_close bug? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Unix, apr_file_close looks like this: APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t rv; if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } return rv; } So if file_cleanup fails, then we won't kill the cleanup, and when we cleanup the file->cntxt pool, we'll run the cleanup again. We used to have this exact same behavior in the directory cleanups and it caused segfaults. I think it should just say this: { apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); return apr_unix_file_cleanup(file); } Which is exactly equivalent to what apr_dir_close() does now that it's been fixed. Thoughts? --Cliff -------------------------------------------------------------- Cliff Woolley cliffwoolley@yahoo.com Charlottesville, VA