summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-03-20 17:57:59 +0000
committerAntony Dovgal <tony2001@php.net>2007-03-20 17:57:59 +0000
commit17d89125b2a917eb1667a570e513965391daa9cb (patch)
tree579a04c3ce9468c60ecbdec47ace1ee3cd271730 /TSRM
parent3ee54ce92464994cb39f45924a75bc5f31992f49 (diff)
downloadphp-git-17d89125b2a917eb1667a570e513965391daa9cb.tar.gz
MFH: fix shmop_open() with IPC_CREAT|IPC_EXCL flags on win32
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_win32.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index b60be0cc9c..5a8983b5e4 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -280,9 +280,6 @@ TSRM_API int shmget(int key, int size, int flags)
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
if ((!shm_handle && !info_handle)) {
- if (flags & IPC_EXCL) {
- return -1;
- }
if (flags & IPC_CREAT) {
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment);
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info);
@@ -291,6 +288,10 @@ TSRM_API int shmget(int key, int size, int flags)
if ((!shm_handle || !info_handle)) {
return -1;
}
+ } else {
+ if (flags & IPC_EXCL) {
+ return -1;
+ }
}
shm = shm_get(key, NULL);