mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.1'
* PHP-7.1: fix error handling
This commit is contained in:
commit
871ea20e9c
1 changed files with 2 additions and 3 deletions
|
@ -725,7 +725,6 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
|||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
|
@ -733,8 +732,8 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
|||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
return (void*)-1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue