@@ -230,11 +230,12 @@ static inline void accel_restart_enter(void)
230
230
#ifdef ZEND_WIN32
231
231
INCREMENT (restart_in );
232
232
#else
233
- # ifdef _AIX
234
- static FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
235
- # else
236
- static const FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
237
- #endif
233
+ struct flock restart_in_progress ;
234
+
235
+ restart_in_progress .l_type = F_WRLCK ;
236
+ restart_in_progress .l_whence = SEEK_SET ;
237
+ restart_in_progress .l_start = 2 ;
238
+ restart_in_progress .l_len = 1 ;
238
239
239
240
if (fcntl (lock_file , F_SETLK , & restart_in_progress ) == -1 ) {
240
241
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC(+1): %s (%d)" , strerror (errno ), errno );
@@ -249,11 +250,12 @@ static inline void accel_restart_leave(void)
249
250
ZCSG (restart_in_progress ) = 0 ;
250
251
DECREMENT (restart_in );
251
252
#else
252
- # ifdef _AIX
253
- static FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
254
- # else
255
- static const FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
256
- # endif
253
+ struct flock restart_finished ;
254
+
255
+ restart_finished .l_type = F_UNLCK ;
256
+ restart_finished .l_whence = SEEK_SET ;
257
+ restart_finished .l_start = 2 ;
258
+ restart_finished .l_len = 1 ;
257
259
258
260
ZCSG (restart_in_progress ) = 0 ;
259
261
if (fcntl (lock_file , F_SETLK , & restart_finished ) == -1 ) {
@@ -266,7 +268,12 @@ static inline int accel_restart_is_active(void)
266
268
{
267
269
if (ZCSG (restart_in_progress )) {
268
270
#ifndef ZEND_WIN32
269
- FLOCK_STRUCTURE (restart_check , F_WRLCK , SEEK_SET , 2 , 1 );
271
+ struct flock restart_check ;
272
+
273
+ restart_check .l_type = F_WRLCK ;
274
+ restart_check .l_whence = SEEK_SET ;
275
+ restart_check .l_start = 2 ;
276
+ restart_check .l_len = 1 ;
270
277
271
278
if (fcntl (lock_file , F_GETLK , & restart_check ) == -1 ) {
272
279
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC: %s (%d)" , strerror (errno ), errno );
@@ -291,11 +298,12 @@ static inline int accel_activate_add(void)
291
298
#ifdef ZEND_WIN32
292
299
INCREMENT (mem_usage );
293
300
#else
294
- # ifdef _AIX
295
- static FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
296
- # else
297
- static const FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
298
- # endif
301
+ struct flock mem_usage_lock ;
302
+
303
+ mem_usage_lock .l_type = F_RDLCK ;
304
+ mem_usage_lock .l_whence = SEEK_SET ;
305
+ mem_usage_lock .l_start = 1 ;
306
+ mem_usage_lock .l_len = 1 ;
299
307
300
308
if (fcntl (lock_file , F_SETLK , & mem_usage_lock ) == -1 ) {
301
309
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(+1): %s (%d)" , strerror (errno ), errno );
@@ -314,11 +322,12 @@ static inline void accel_deactivate_sub(void)
314
322
ZCG (counted ) = 0 ;
315
323
}
316
324
#else
317
- # ifdef _AIX
318
- static FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
319
- # else
320
- static const FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
321
- # endif
325
+ struct flock mem_usage_unlock ;
326
+
327
+ mem_usage_unlock .l_type = F_UNLCK ;
328
+ mem_usage_unlock .l_whence = SEEK_SET ;
329
+ mem_usage_unlock .l_start = 1 ;
330
+ mem_usage_unlock .l_len = 1 ;
322
331
323
332
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock ) == -1 ) {
324
333
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(-1): %s (%d)" , strerror (errno ), errno );
@@ -331,11 +340,12 @@ static inline void accel_unlock_all(void)
331
340
#ifdef ZEND_WIN32
332
341
accel_deactivate_sub ();
333
342
#else
334
- # ifdef _AIX
335
- static FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
336
- # else
337
- static const FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
338
- # endif
343
+ struct flock mem_usage_unlock_all ;
344
+
345
+ mem_usage_unlock_all .l_type = F_UNLCK ;
346
+ mem_usage_unlock_all .l_whence = SEEK_SET ;
347
+ mem_usage_unlock_all .l_start = 0 ;
348
+ mem_usage_unlock_all .l_len = 0 ;
339
349
340
350
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock_all ) == -1 ) {
341
351
zend_accel_error (ACCEL_LOG_DEBUG , "UnlockAll: %s (%d)" , strerror (errno ), errno );
@@ -730,8 +740,12 @@ static inline int accel_is_inactive(void)
730
740
return SUCCESS ;
731
741
}
732
742
#else
733
- FLOCK_STRUCTURE ( mem_usage_check , F_WRLCK , SEEK_SET , 1 , 1 ) ;
743
+ struct flock mem_usage_check ;
734
744
745
+ mem_usage_check .l_type = F_WRLCK ;
746
+ mem_usage_check .l_whence = SEEK_SET ;
747
+ mem_usage_check .l_start = 1 ;
748
+ mem_usage_check .l_len = 1 ;
735
749
mem_usage_check .l_pid = -1 ;
736
750
if (fcntl (lock_file , F_GETLK , & mem_usage_check ) == -1 ) {
737
751
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC: %s (%d)" , strerror (errno ), errno );
0 commit comments