com php-src: The "flock" structure has to be writable on AIX.: ext/opcache/ZendAccelerator.c
| From: | Dmitry Stogov | Date: | Tue, 10 May 2016 14:50:14 +0000 |
| Subject: | com php-src: The "flock" structure has to be writable on AIX.: ext/opcache/ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92079@lists.php.net to get a copy of this message | ||
Commit: 90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe
Author: Dmitry Stogov <dmitry@zend.com> Tue, 10 May 2016 17:50:14 +0300
Parents: 0ea2bfb30e9f8262f6f76e413c16fc98af647aab
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe
Log:
The "flock" structure has to be writable on AIX.
Changed paths:
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 0f66c56..418b4a3 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -482,7 +482,11 @@ static inline void accel_restart_enter(TSRMLS_D)
#ifdef ZEND_WIN32
INCREMENT(restart_in);
#else
+# ifdef _AIX
+ static FLOCK_STRUCTURE(restart_in_progress, F_WRLCK, SEEK_SET, 2, 1);
+# else
static const FLOCK_STRUCTURE(restart_in_progress, F_WRLCK, SEEK_SET, 2, 1);
+#endif
if (fcntl(lock_file, F_SETLK, &restart_in_progress) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "RestartC(+1): %s (%d)", strerror(errno), errno);
@@ -497,7 +501,11 @@ static inline void accel_restart_leave(TSRMLS_D)
ZCSG(restart_in_progress) = 0;
DECREMENT(restart_in);
#else
+# ifdef _AIX
+ static FLOCK_STRUCTURE(restart_finished, F_UNLCK, SEEK_SET, 2, 1);
+# else
static const FLOCK_STRUCTURE(restart_finished, F_UNLCK, SEEK_SET, 2, 1);
+# endif
ZCSG(restart_in_progress) = 0;
if (fcntl(lock_file, F_SETLK, &restart_finished) == -1) {
@@ -535,7 +543,11 @@ static inline void accel_activate_add(TSRMLS_D)
#ifdef ZEND_WIN32
INCREMENT(mem_usage);
#else
+# ifdef _AIX
+ static FLOCK_STRUCTURE(mem_usage_lock, F_RDLCK, SEEK_SET, 1, 1);
+# else
static const FLOCK_STRUCTURE(mem_usage_lock, F_RDLCK, SEEK_SET, 1, 1);
+# endif
if (fcntl(lock_file, F_SETLK, &mem_usage_lock) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UpdateC(+1): %s (%d)", strerror(errno), errno);
@@ -552,7 +564,11 @@ static inline void accel_deactivate_sub(TSRMLS_D)
ZCG(counted) = 0;
}
#else
+# ifdef _AIX
+ static FLOCK_STRUCTURE(mem_usage_unlock, F_UNLCK, SEEK_SET, 1, 1);
+# else
static const FLOCK_STRUCTURE(mem_usage_unlock, F_UNLCK, SEEK_SET, 1, 1);
+# endif
if (fcntl(lock_file, F_SETLK, &mem_usage_unlock) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UpdateC(-1): %s (%d)", strerror(errno), errno);
@@ -565,7 +581,11 @@ static inline void accel_unlock_all(TSRMLS_D)
#ifdef ZEND_WIN32
accel_deactivate_sub(TSRMLS_C);
#else
+# ifdef _AIX
+ static FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
+# else
static const FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
+# endif
if (fcntl(lock_file, F_SETLK, &mem_usage_unlock_all) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "UnlockAll: %s (%d)", strerror(errno), errno);