From commits-return-8803-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sat Oct 13 00:02:16 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 24106 invoked from network); 13 Oct 2007 00:02:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2007 00:02:16 -0000 Received: (qmail 54284 invoked by uid 500); 13 Oct 2007 00:02:03 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 54244 invoked by uid 500); 13 Oct 2007 00:02:03 -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 54233 invoked by uid 99); 13 Oct 2007 00:02:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2007 17:02:03 -0700 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; Sat, 13 Oct 2007 00:02:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BC20A1A9832; Fri, 12 Oct 2007 17:01:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r584341 - in /apr/apr/branches/1.2.x: CHANGES shmem/win32/shm.c Date: Sat, 13 Oct 2007 00:00:47 -0000 To: commits@apr.apache.org From: davi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071013000114.BC20A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davi Date: Fri Oct 12 17:00:46 2007 New Revision: 584341 URL: http://svn.apache.org/viewvc?rev=584341&view=rev Log: Backport revision 584331 from trunk: The calls to UnmapViewOfFile() and CloseHandle() in the shm_cleanup() routine in the win32/shm.c source are not properly checking for errors. They currently assume a non-zero return is an error.Whereas these windows calls return non-zero on success and zero on failure. PR: 43065 Submitted by: Joe Mudd Modified: apr/apr/branches/1.2.x/CHANGES apr/apr/branches/1.2.x/shmem/win32/shm.c Modified: apr/apr/branches/1.2.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=584341&r1=584340&r2=584341&view=diff ============================================================================== --- apr/apr/branches/1.2.x/CHANGES [utf-8] (original) +++ apr/apr/branches/1.2.x/CHANGES [utf-8] Fri Oct 12 17:00:46 2007 @@ -1,6 +1,10 @@  -*- coding: utf-8 -*- Changes for APR 1.2.12 + *) The WIN32 cleanup routine for shared memory segments could wrongly + return unknown errors and leak a open handle. + [Joe Mudd ] + *) apr_procattr_io_set() on Windows: Set pipe handles non-blocking as appropriate based on the input parameters. PR 43522. [Eric Covener ] Modified: apr/apr/branches/1.2.x/shmem/win32/shm.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/shmem/win32/shm.c?rev=584341&r1=584340&r2=584341&view=diff ============================================================================== --- apr/apr/branches/1.2.x/shmem/win32/shm.c (original) +++ apr/apr/branches/1.2.x/shmem/win32/shm.c Fri Oct 12 17:00:46 2007 @@ -40,10 +40,10 @@ apr_status_t rv = APR_SUCCESS; apr_shm_t *m = shm; - if (UnmapViewOfFile(m->memblk)) { + if (!UnmapViewOfFile(m->memblk)) { rv = apr_get_os_error(); } - if (CloseHandle(m->hMap)) { + if (!CloseHandle(m->hMap)) { return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); } /* ### Do we want to make a point of unlinking m->file here?