mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
MFH: fix shmop_open() with IPC_CREAT|IPC_EXCL flags on win32
This commit is contained in:
parent
3ee54ce924
commit
17d89125b2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user