iliaa           Sun Nov 23 20:44:00 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src    NEWS 
    /php-src/ext/standard       file.c 
  Log:
  MFH: Fixed bug #26355 (flock() doesn't initialize the wouldblock argument)
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.475 php-src/NEWS:1.1247.2.476
--- php-src/NEWS:1.1247.2.475   Sat Nov 22 08:40:39 2003
+++ php-src/NEWS        Sun Nov 23 20:43:58 2003
@@ -3,6 +3,7 @@
 ?? ??? 2003, Version 4.3.5
 - Fixed header handler in NSAPI SAPI module (header->replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26355 (flock() doesn't initialize the wouldblock argument). (Ilia)
 - Fixed bug #26309 (Fixed argument parsing for imageftbbox()). (Ilia)
 - Fixed bug #26285 (escapeshellarg() uses wrong quotes on windows). (Ilia)
 - Fixed bug #26267 (gmp_random() leaks memory and does not produce random
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.279.2.39 php-src/ext/standard/file.c:1.279.2.40
--- php-src/ext/standard/file.c:1.279.2.39      Fri Nov  7 16:40:46 2003
+++ php-src/ext/standard/file.c Sun Nov 23 20:43:59 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.279.2.39 2003/11/07 21:40:46 iliaa Exp $ */
+/* $Id: file.c,v 1.279.2.40 2003/11/24 01:43:59 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -247,12 +247,17 @@
                RETURN_FALSE;
        }
 
+       if (arg_count == 3) {
+               convert_to_long_ex(arg3);
+               Z_LVAL_PP(arg3) = 0;
+       }
+
        /* flock_values contains all possible actions
           if (arg2 & 4) we won't block on the lock */
        act = flock_values[act - 1] | (Z_LVAL_PP(arg2) & 4 ? LOCK_NB : 0);
        if (flock(fd, act)) {
                if (errno == EWOULDBLOCK && arg_count == 3) {
-                       ZVAL_LONG(*arg3, 1);
+                       Z_LVAL_PP(arg3) = 1;
                } else {
                        RETURN_FALSE;
                }       

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

Reply via email to