You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/07 17:06:01 UTC
svn commit: r802035 -
/commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c
Author: mturk
Date: Fri Aug 7 15:06:01 2009
New Revision: 802035
URL: http://svn.apache.org/viewvc?rev=802035&view=rev
Log:
Allow r/w access. Probably not needed cause we close the file later
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c?rev=802035&r1=802034&r2=802035&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c Fri Aug 7 15:06:01 2009
@@ -143,7 +143,7 @@
*/
hfile = CreateFileW(filename,
GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
@@ -154,8 +154,10 @@
}
if (SetFilePointer(hfile, sizelo, lpdwhi, FILE_BEGIN) == INVALID_SET_FILE_POINTER) {
rc = ACR_GET_OS_ERROR();
- CloseHandle(hfile);
- goto cleanup;
+ if (rc) {
+ CloseHandle(hfile);
+ goto cleanup;
+ }
}
/* res_name_from_filename turns file into a pseudo-name
* without slashes or backslashes, and prepends the \global