]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #26355 (flock() doesn't initialize the wouldblock argument)
authorIlia Alshanetsky <iliaa@php.net>
Mon, 24 Nov 2003 01:43:59 +0000 (01:43 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 24 Nov 2003 01:43:59 +0000 (01:43 +0000)
NEWS
ext/standard/file.c

diff --git a/NEWS b/NEWS
index bf33a34538ac010f01618bb5d961a6678016a992..ab54bdc1a77f18e070a9fae69af6592e9cee6bc0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP 4                                                                      NEWS
 ?? ??? 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 246790db4039549fd46c1c89d352d23eac8fdc81..e389b2457f91e5d12574e92b62453c7fecba33d2 100644 (file)
@@ -247,12 +247,17 @@ PHP_FUNCTION(flock)
                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;
                }