From: Anatol Belski Date: Thu, 18 Aug 2016 13:58:33 +0000 (+0200) Subject: avoid other efforts if memory mapping fails X-Git-Tag: php-7.1.0beta3~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98d8794eae787571e061b3f07bbd196fa373fa48;p=php avoid other efforts if memory mapping fails --- 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; }