Skip to content

Commit 07fd8ce

Browse files
committed
Explicitly define stupid flock constants
1 parent 63cf603 commit 07fd8ce

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ext/spl/spl_directory.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,10 +2548,17 @@ PHP_METHOD(SplFileObject, getCsvControl)
25482548
}
25492549
/* }}} */
25502550

2551-
/* {{{ Portable file locking, copy pasted from ext/standard/file.c flock() function.
2552-
* This is done to prevent this to fail if flock is disabled via disable_functions */
2551+
/* Because apparently it doesn't want to pull them from flock_compat.h for some stupid reason */
2552+
#define LOCK_SH 1
2553+
#define LOCK_EX 2
2554+
#define LOCK_NB 4
2555+
#define LOCK_UN 8
2556+
2557+
25532558
static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
25542559

2560+
/* {{{ Portable file locking, copy pasted from ext/standard/file.c flock() function.
2561+
* This is done to prevent this to fail if flock is disabled via disable_functions */
25552562
PHP_METHOD(SplFileObject, flock)
25562563
{
25572564
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);

0 commit comments

Comments
 (0)