com php-src: Merge branch 'PHP-7.0' into PHP-7.1: TSRM/tsrm_w in32.c
| From: | Anatol Belski | Date: | Sat, 15 Apr 2017 16:25:31 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.0' into PHP-7.1: TSRM/tsrm_w in32.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97627@lists.php.net to get a copy of this message | ||
Commit: 5bd0baa89193c99e36a957f91e10977c3b3664b4
Author: Anatol Belski <ab@php.net> 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;
}