]> granicus.if.org Git - php/commitdiff
avoid other efforts if memory mapping fails
authorAnatol Belski <ab@php.net>
Thu, 18 Aug 2016 13:58:33 +0000 (15:58 +0200)
committerAnatol Belski <ab@php.net>
Thu, 18 Aug 2016 13:58:33 +0000 (15:58 +0200)
TSRM/tsrm_win32.c

index ab20e1f98bb9f329664624c82166fabcc5db527e..c9ee134a9dbe6c650f6a97137ddbbd06f299149f 100644 (file)
@@ -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;
 }