|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-09 21:35 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 04:00:01 2025 UTC |
Description: ------------ From documentation about 'flock': The optional third argument is set to TRUE if the lock would block (EWOULDBLOCK errno condition) Actualy third argument will never set to true due to error in implementation. Let see the code (line 253 in 'file.c'): if ((ret=flock(fd, act)) == -1) { RETURN_FALSE; } if(ret == -1 && errno == EWOULDBLOCK && arg_count == 3) { ZVAL_LONG(*arg3, 1); } The second 'if' will never act as if ret==1 function immediately returns false in the first 'if' Here is my version: if ((ret=flock(fd, act)) == -1) { if( errno == EWOULDBLOCK && arg_count == 3) ZVAL_LONG(arg3, 1); RETURN_FALSE; }