summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 27053fe271..eee56700d5 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -364,7 +364,11 @@ PHP_FUNCTION(flock)
/* flock_values contains all possible actions if (operation & 4) we won't block on the lock */
act = flock_values[act - 1] | (operation & PHP_LOCK_NB ? LOCK_NB : 0);
if (php_stream_lock(stream, act)) {
+#ifdef PHP_WIN32
+ if (operation && errno == ERROR_INVALID_BLOCK && wouldblock) {
+#else
if (operation && errno == EWOULDBLOCK && wouldblock) {
+#endif
ZVAL_LONG(wouldblock, 1);
}
RETURN_FALSE;