@@ -236,11 +236,12 @@ static inline void accel_restart_enter(void)
236
236
#ifdef ZEND_WIN32
237
237
INCREMENT (restart_in );
238
238
#else
239
- # ifdef _AIX
240
- static FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
241
- # else
242
- static const FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
243
- #endif
239
+ struct flock restart_in_progress ;
240
+
241
+ restart_in_progress .l_type = F_WRLCK ;
242
+ restart_in_progress .l_whence = SEEK_SET ;
243
+ restart_in_progress .l_start = 2 ;
244
+ restart_in_progress .l_len = 1 ;
244
245
245
246
if (fcntl (lock_file , F_SETLK , & restart_in_progress ) == -1 ) {
246
247
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC(+1): %s (%d)" , strerror (errno ), errno );
@@ -255,11 +256,12 @@ static inline void accel_restart_leave(void)
255
256
ZCSG (restart_in_progress ) = 0 ;
256
257
DECREMENT (restart_in );
257
258
#else
258
- # ifdef _AIX
259
- static FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
260
- # else
261
- static const FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
262
- # endif
259
+ struct flock restart_finished ;
260
+
261
+ restart_finished .l_type = F_UNLCK ;
262
+ restart_finished .l_whence = SEEK_SET ;
263
+ restart_finished .l_start = 2 ;
264
+ restart_finished .l_len = 1 ;
263
265
264
266
ZCSG (restart_in_progress ) = 0 ;
265
267
if (fcntl (lock_file , F_SETLK , & restart_finished ) == -1 ) {
@@ -272,7 +274,12 @@ static inline int accel_restart_is_active(void)
272
274
{
273
275
if (ZCSG (restart_in_progress )) {
274
276
#ifndef ZEND_WIN32
275
- FLOCK_STRUCTURE (restart_check , F_WRLCK , SEEK_SET , 2 , 1 );
277
+ struct flock restart_check ;
278
+
279
+ restart_check .l_type = F_WRLCK ;
280
+ restart_check .l_whence = SEEK_SET ;
281
+ restart_check .l_start = 2 ;
282
+ restart_check .l_len = 1 ;
276
283
277
284
if (fcntl (lock_file , F_GETLK , & restart_check ) == -1 ) {
278
285
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC: %s (%d)" , strerror (errno ), errno );
@@ -297,11 +304,12 @@ static inline int accel_activate_add(void)
297
304
#ifdef ZEND_WIN32
298
305
INCREMENT (mem_usage );
299
306
#else
300
- # ifdef _AIX
301
- static FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
302
- # else
303
- static const FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
304
- # endif
307
+ struct flock mem_usage_lock ;
308
+
309
+ mem_usage_lock .l_type = F_RDLCK ;
310
+ mem_usage_lock .l_whence = SEEK_SET ;
311
+ mem_usage_lock .l_start = 1 ;
312
+ mem_usage_lock .l_len = 1 ;
305
313
306
314
if (fcntl (lock_file , F_SETLK , & mem_usage_lock ) == -1 ) {
307
315
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(+1): %s (%d)" , strerror (errno ), errno );
@@ -320,11 +328,12 @@ static inline void accel_deactivate_sub(void)
320
328
ZCG (counted ) = 0 ;
321
329
}
322
330
#else
323
- # ifdef _AIX
324
- static FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
325
- # else
326
- static const FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
327
- # endif
331
+ struct flock mem_usage_unlock ;
332
+
333
+ mem_usage_unlock .l_type = F_UNLCK ;
334
+ mem_usage_unlock .l_whence = SEEK_SET ;
335
+ mem_usage_unlock .l_start = 1 ;
336
+ mem_usage_unlock .l_len = 1 ;
328
337
329
338
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock ) == -1 ) {
330
339
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(-1): %s (%d)" , strerror (errno ), errno );
@@ -337,11 +346,12 @@ static inline void accel_unlock_all(void)
337
346
#ifdef ZEND_WIN32
338
347
accel_deactivate_sub ();
339
348
#else
340
- # ifdef _AIX
341
- static FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
342
- # else
343
- static const FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
344
- # endif
349
+ struct flock mem_usage_unlock_all ;
350
+
351
+ mem_usage_unlock_all .l_type = F_UNLCK ;
352
+ mem_usage_unlock_all .l_whence = SEEK_SET ;
353
+ mem_usage_unlock_all .l_start = 0 ;
354
+ mem_usage_unlock_all .l_len = 0 ;
345
355
346
356
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock_all ) == -1 ) {
347
357
zend_accel_error (ACCEL_LOG_DEBUG , "UnlockAll: %s (%d)" , strerror (errno ), errno );
@@ -830,8 +840,12 @@ static inline int accel_is_inactive(void)
830
840
return SUCCESS ;
831
841
}
832
842
#else
833
- FLOCK_STRUCTURE ( mem_usage_check , F_WRLCK , SEEK_SET , 1 , 1 ) ;
843
+ struct flock mem_usage_check ;
834
844
845
+ mem_usage_check .l_type = F_WRLCK ;
846
+ mem_usage_check .l_whence = SEEK_SET ;
847
+ mem_usage_check .l_start = 1 ;
848
+ mem_usage_check .l_len = 1 ;
835
849
mem_usage_check .l_pid = -1 ;
836
850
if (fcntl (lock_file , F_GETLK , & mem_usage_check ) == -1 ) {
837
851
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC: %s (%d)" , strerror (errno ), errno );
0 commit comments