com php-src: Merge branch 'PHP-7.0' into PHP-7.1: TSRM/tsrm_w in32.c
[email protected] (Anatol Belski)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 5bd0baa89193c99e36a957f91e10977c3b3664b4 Author: Anatol Belski <[email protected]> Sat, 15 Apr 2017 18:25:31 +0200 Parents: 2719b8e91cf3ebbaf7789a6d86ec35ae29928545 9719621e078e41aa2d387cea4d4b1dd956c9e1e2 Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5bd0baa89193c99e36a957f91e10977c3b3664b4 Log: Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: fix error handling Changed paths: MM TSRM/tsrm_win32.c Diff: diff --cc TSRM/tsrm_win32.c index df06644,9c5fe55..1023829 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@@ -729,9 -678,12 +728,9 @@@ TSRM_API void *shmat(int key, const voi shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - err = GetLastError(); - if (err) { + if (NULL == shm->addr) { + int err = GetLastError(); - /* Catch more errors */ - if (ERROR_NOT_ENOUGH_MEMORY == err) { - _set_errno(ENOMEM); - } + SET_ERRNO_FROM_WIN32_CODE(err); return (void*)-1; }