Bug 43065

Summary: Fix windows shared memory cleanup return code checking
Product: APR Reporter: Joe Mudd <Joe.Mudd>
Component: APRAssignee: Apache Portable Runtime bugs mailinglist <bugs>
Status: RESOLVED FIXED    
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 1.2.8   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: shm.c.diff

Description Joe Mudd 2007-08-08 13:56:36 UTC
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.
Comment 1 Joe Mudd 2007-08-08 13:57:38 UTC
Created attachment 20616 [details]
shm.c.diff

win32/shm.c patch
Comment 2 Davi Arnaut 2007-08-08 14:22:31 UTC
Patch seems right. Microsoft documentation of the functions:

"If the function succeeds, the return value is nonzero."

Will commit shortly, thanks!

Comment 3 Joe Mudd 2007-09-17 13:49:47 UTC
I do not see this patch in the trunk.  Was it committed elsewhere?  Thanks.
Comment 4 Davi Arnaut 2007-10-12 17:01:52 UTC
Patch committed to trunk in revision 584331:

http://svn.apache.org/viewvc?view=rev&revision= 584331

Backported to 1.2.x in revision 584341:

http://svn.apache.org/viewvc?view=rev&revision=584341

Thanks for using APR.