|
|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsAllCommentsChangesGit/SVN commits
[2003-10-09 21:35 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
|
All rights reserved. |
Last updated: Thu Apr 09 07:00:01 2026 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; }