mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
avoid other efforts if memory mapping fails
This commit is contained in:
parent
91cd55e32a
commit
98d8794eae
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user