diff options
author | Anatol Belski <ab@php.net> | 2016-08-18 15:58:33 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-08-18 15:58:33 +0200 |
commit | 98d8794eae787571e061b3f07bbd196fa373fa48 (patch) | |
tree | ff5fde9511ac1f3be399b37f0cc8607ef92d8546 | |
parent | 91cd55e32a60efc01ea20897204048be495e9d96 (diff) | |
download | php-git-98d8794eae787571e061b3f07bbd196fa373fa48.tar.gz |
avoid other efforts if memory mapping fails
-rw-r--r-- | TSRM/tsrm_win32.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index ab20e1f98b..c9ee134a9d 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -671,10 +671,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags) return (void*)-1; } - shm->descriptor->shm_atime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch++; - shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); err = GetLastError(); @@ -686,6 +682,10 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags) return (void*)-1; } + shm->descriptor->shm_atime = time(NULL); + shm->descriptor->shm_lpid = getpid(); + shm->descriptor->shm_nattch++; + return shm->addr; } |