You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by da...@apache.org on 2007/10/13 01:43:14 UTC

svn commit: r584331 - /apr/apr/trunk/shmem/win32/shm.c

Author: davi
Date: Fri Oct 12 16:43:14 2007
New Revision: 584331

URL: http://svn.apache.org/viewvc?rev=584331&view=rev
Log:
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/trunk/shmem/win32/shm.c

Modified: apr/apr/trunk/shmem/win32/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/shmem/win32/shm.c?rev=584331&r1=584330&r2=584331&view=diff
==============================================================================
--- apr/apr/trunk/shmem/win32/shm.c (original)
+++ apr/apr/trunk/shmem/win32/shm.c Fri Oct 12 16:43:14 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?