summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-05-10 17:53:33 +0300
committerDmitry Stogov <dmitry@zend.com>2016-05-10 17:53:33 +0300
commitf7372f648fdf9ea91e2414b394f786a01f7f0496 (patch)
tree570938adc8ffdc72bc9ebce48f70a7464a5ed9c8
parent09dae4dc8539594a390692700cf69d4118607953 (diff)
parent90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe (diff)
downloadphp-git-f7372f648fdf9ea91e2414b394f786a01f7f0496.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: The "flock" structure has to be writable on AIX.
-rw-r--r--ext/opcache/ZendAccelerator.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 8eddb4b76e..fab8975b98 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -225,7 +225,11 @@ static inline void accel_restart_enter(void)
#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);
@@ -240,7 +244,11 @@ static inline void accel_restart_leave(void)
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) {
@@ -278,7 +286,11 @@ static inline int accel_activate_add(void)
#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);
@@ -297,7 +309,11 @@ static inline void accel_deactivate_sub(void)
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);
@@ -310,7 +326,11 @@ static inline void accel_unlock_all(void)
#ifdef ZEND_WIN32
accel_deactivate_sub();
#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);