diff options
author | Dmitry Stogov <dmitry@zend.com> | 2016-05-10 17:50:14 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2016-05-10 17:50:14 +0300 |
commit | 90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe (patch) | |
tree | ea8dce4b4a18ad8cac0271738ba168735d68d2cd | |
parent | 0ea2bfb30e9f8262f6f76e413c16fc98af647aab (diff) | |
download | php-git-90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe.tar.gz |
The "flock" structure has to be writable on AIX.
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 0f66c56ea6..418b4a3add 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); |