@@ -238,11 +238,12 @@ static inline void accel_restart_enter(void)
238
238
#ifdef ZEND_WIN32
239
239
INCREMENT (restart_in );
240
240
#else
241
- # ifdef _AIX
242
- static FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
243
- # else
244
- static const FLOCK_STRUCTURE (restart_in_progress , F_WRLCK , SEEK_SET , 2 , 1 ) ;
245
- #endif
241
+ struct flock restart_in_progress ;
242
+
243
+ restart_in_progress .l_type = F_WRLCK ;
244
+ restart_in_progress .l_whence = SEEK_SET ;
245
+ restart_in_progress .l_start = 2 ;
246
+ restart_in_progress .l_len = 1 ;
246
247
247
248
if (fcntl (lock_file , F_SETLK , & restart_in_progress ) == -1 ) {
248
249
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC(+1): %s (%d)" , strerror (errno ), errno );
@@ -257,11 +258,12 @@ static inline void accel_restart_leave(void)
257
258
ZCSG (restart_in_progress ) = 0 ;
258
259
DECREMENT (restart_in );
259
260
#else
260
- # ifdef _AIX
261
- static FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
262
- # else
263
- static const FLOCK_STRUCTURE (restart_finished , F_UNLCK , SEEK_SET , 2 , 1 ) ;
264
- # endif
261
+ struct flock restart_finished ;
262
+
263
+ restart_finished .l_type = F_UNLCK ;
264
+ restart_finished .l_whence = SEEK_SET ;
265
+ restart_finished .l_start = 2 ;
266
+ restart_finished .l_len = 1 ;
265
267
266
268
ZCSG (restart_in_progress ) = 0 ;
267
269
if (fcntl (lock_file , F_SETLK , & restart_finished ) == -1 ) {
@@ -274,7 +276,12 @@ static inline int accel_restart_is_active(void)
274
276
{
275
277
if (ZCSG (restart_in_progress )) {
276
278
#ifndef ZEND_WIN32
277
- FLOCK_STRUCTURE (restart_check , F_WRLCK , SEEK_SET , 2 , 1 );
279
+ struct flock restart_check ;
280
+
281
+ restart_check .l_type = F_WRLCK ;
282
+ restart_check .l_whence = SEEK_SET ;
283
+ restart_check .l_start = 2 ;
284
+ restart_check .l_len = 1 ;
278
285
279
286
if (fcntl (lock_file , F_GETLK , & restart_check ) == -1 ) {
280
287
zend_accel_error (ACCEL_LOG_DEBUG , "RestartC: %s (%d)" , strerror (errno ), errno );
@@ -299,11 +306,12 @@ static inline int accel_activate_add(void)
299
306
#ifdef ZEND_WIN32
300
307
INCREMENT (mem_usage );
301
308
#else
302
- # ifdef _AIX
303
- static FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
304
- # else
305
- static const FLOCK_STRUCTURE (mem_usage_lock , F_RDLCK , SEEK_SET , 1 , 1 ) ;
306
- # endif
309
+ struct flock mem_usage_lock ;
310
+
311
+ mem_usage_lock .l_type = F_RDLCK ;
312
+ mem_usage_lock .l_whence = SEEK_SET ;
313
+ mem_usage_lock .l_start = 1 ;
314
+ mem_usage_lock .l_len = 1 ;
307
315
308
316
if (fcntl (lock_file , F_SETLK , & mem_usage_lock ) == -1 ) {
309
317
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(+1): %s (%d)" , strerror (errno ), errno );
@@ -322,11 +330,12 @@ static inline void accel_deactivate_sub(void)
322
330
ZCG (counted ) = 0 ;
323
331
}
324
332
#else
325
- # ifdef _AIX
326
- static FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
327
- # else
328
- static const FLOCK_STRUCTURE (mem_usage_unlock , F_UNLCK , SEEK_SET , 1 , 1 ) ;
329
- # endif
333
+ struct flock mem_usage_unlock ;
334
+
335
+ mem_usage_unlock .l_type = F_UNLCK ;
336
+ mem_usage_unlock .l_whence = SEEK_SET ;
337
+ mem_usage_unlock .l_start = 1 ;
338
+ mem_usage_unlock .l_len = 1 ;
330
339
331
340
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock ) == -1 ) {
332
341
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC(-1): %s (%d)" , strerror (errno ), errno );
@@ -339,11 +348,12 @@ static inline void accel_unlock_all(void)
339
348
#ifdef ZEND_WIN32
340
349
accel_deactivate_sub ();
341
350
#else
342
- # ifdef _AIX
343
- static FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
344
- # else
345
- static const FLOCK_STRUCTURE (mem_usage_unlock_all , F_UNLCK , SEEK_SET , 0 , 0 ) ;
346
- # endif
351
+ struct flock mem_usage_unlock_all ;
352
+
353
+ mem_usage_unlock_all .l_type = F_UNLCK ;
354
+ mem_usage_unlock_all .l_whence = SEEK_SET ;
355
+ mem_usage_unlock_all .l_start = 0 ;
356
+ mem_usage_unlock_all .l_len = 0 ;
347
357
348
358
if (fcntl (lock_file , F_SETLK , & mem_usage_unlock_all ) == -1 ) {
349
359
zend_accel_error (ACCEL_LOG_DEBUG , "UnlockAll: %s (%d)" , strerror (errno ), errno );
@@ -812,8 +822,12 @@ static inline int accel_is_inactive(void)
812
822
return SUCCESS ;
813
823
}
814
824
#else
815
- FLOCK_STRUCTURE ( mem_usage_check , F_WRLCK , SEEK_SET , 1 , 1 ) ;
825
+ struct flock mem_usage_check ;
816
826
827
+ mem_usage_check .l_type = F_WRLCK ;
828
+ mem_usage_check .l_whence = SEEK_SET ;
829
+ mem_usage_check .l_start = 1 ;
830
+ mem_usage_check .l_len = 1 ;
817
831
mem_usage_check .l_pid = -1 ;
818
832
if (fcntl (lock_file , F_GETLK , & mem_usage_check ) == -1 ) {
819
833
zend_accel_error (ACCEL_LOG_DEBUG , "UpdateC: %s (%d)" , strerror (errno ), errno );
0 commit comments