From 79ca8b519c5f207763713538d90aeda067617cf3 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 12 Oct 2007 23:43:14 +0000 Subject: 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 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584331 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shmem') diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index a7260bdb2..7bce1331b 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -40,10 +40,10 @@ static apr_status_t shm_cleanup(void* shm) 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? -- cgit v1.2.1