Was this problem only in PHP5.* ?

    --Jani


On Wed, 6 Apr 2005, Ilia Alshanetsky wrote:

iliaa           Wed Apr  6 09:57:31 2005 EDT

 Modified files:
   /php-src/ext/standard        file.c
   /php-src/main/streams        plain_wrapper.c
 Log:
 Fixed bug #31363 (broken non-blocking flock()).

 # Patch by ian at snork dot net


http://cvs.php.net/diff.php/php-src/ext/standard/file.c?r1=1.405&r2=1.406&ty=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.405 php-src/ext/standard/file.c:1.406 --- php-src/ext/standard/file.c:1.405 Sun Mar 27 10:52:49 2005 +++ php-src/ext/standard/file.c Wed Apr 6 09:57:30 2005 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */

-/* $Id: file.c,v 1.405 2005/03/27 15:52:49 iliaa Exp $ */
+/* $Id: file.c,v 1.406 2005/04/06 13:57:30 iliaa Exp $ */

/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */

@@ -339,13 +339,13 @@

        /* flock_values contains all possible actions if (operation & 4) we 
won't block on the lock */
        act = flock_values[act - 1] | (operation & 4 ? LOCK_NB : 0);
-       if (!php_stream_lock(stream, act)) {
+       if (php_stream_lock(stream, act)) {
                if (operation && errno == EWOULDBLOCK && arg3 && 
PZVAL_IS_REF(arg3)) {
                        Z_LVAL_P(arg3) = 1;
                }
-               RETURN_TRUE;
+               RETURN_FALSE;
        }
-       RETURN_FALSE;
+       RETURN_TRUE;
}

/* }}} */
http://cvs.php.net/diff.php/php-src/main/streams/plain_wrapper.c?r1=1.42&r2=1.43&ty=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.42 
php-src/main/streams/plain_wrapper.c:1.43
--- php-src/main/streams/plain_wrapper.c:1.42   Thu Oct 28 01:05:20 2004
+++ php-src/main/streams/plain_wrapper.c        Wed Apr  6 09:57:30 2005
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */

-/* $Id: plain_wrapper.c,v 1.42 2004/10/28 05:05:20 tony2001 Exp $ */
+/* $Id: plain_wrapper.c,v 1.43 2005/04/06 13:57:30 iliaa Exp $ */

#include "php.h"
#include "php_globals.h"
@@ -578,7 +578,7 @@
                                return 0;
                        }

-                       if (!flock(fd, value) || (errno == EWOULDBLOCK && value 
& LOCK_NB)) {
+                       if (!flock(fd, value)) {
                                data->lock_flag = value;
                                return 0;
                        } else {



-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to