com php-src: avoid other efforts if memory mapping fails: TSRM/tsrm_win32.c
| From: | Anatol Belski | Date: | Thu, 18 Aug 2016 13:58:33 +0000 |
| Subject: | com php-src: avoid other efforts if memory mapping fails: TSRM/tsrm_win32.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93973@lists.php.net to get a copy of this message | ||
Commit: 98d8794eae787571e061b3f07bbd196fa373fa48
Author: Anatol Belski <ab@php.net> Thu, 18 Aug 2016 15:58:33 +0200
Parents: 91cd55e32a60efc01ea20897204048be495e9d96
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=98d8794eae787571e061b3f07bbd196fa373fa48
Log:
avoid other efforts if memory mapping fails
Changed paths:
M TSRM/tsrm_win32.c
Diff:
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index ab20e1f..c9ee134 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -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;
}