From 90f43caf5bb0e371eac3a268c28f16fcd6e5e8fe Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 10 May 2016 17:50:14 +0300 Subject: The "flock" structure has to be writable on AIX. --- ext/opcache/ZendAccelerator.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ext/opcache') 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); -- cgit v1.2.1