Bug 61702 - flock() broke in php-4.0.6-13
Summary: flock() broke in php-4.0.6-13
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: php
Version: 7.0
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-23 05:56 UTC by Alexander Kourakos
Modified: 2007-03-27 03:52 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-04-05 12:28:02 UTC
Embargoed:


Attachments (Terms of Use)
flock() test script (280 bytes, text/plain)
2002-03-23 05:58 UTC, Alexander Kourakos
no flags Details

Description Alexander Kourakos 2002-03-23 05:56:11 UTC
Description of Problem: flock($open_fp, LOCK_EX) always returns a false value
(and fails to lock).

Version-Release number of selected component (if applicable): php-4.0.6-13

How Reproducible: I used the following command-line script (but the bug occurs
from within mod_php too):

#!/usr/bin/php -q
<?php
  if (!($fp = fopen('/tmp/lock.file', 'r'))) {
    die("couldn't open file to lock\n");
  } else {
    flock($fp, LOCK_EX) or print "couldn't get lock!!\n";
    print "HELLO\n"; sleep(5); print "GOODBYE\n";
    flock($fp, LOCK_UN);
    fclose($fp);
  }
?>

Additional Information:
It was working fine in php-4.0.6-9.7.0

Comment 1 Alexander Kourakos 2002-03-23 05:58:16 UTC
Created attachment 49807 [details]
flock() test script

Comment 2 Joe Orton 2004-04-05 12:28:02 UTC
Thanks for the report.  This seems to work OK in current release when
the test script is corrected to pass 'w' to fopen; please reopen if
there are still problems.


Note You need to log in before you can comment on or make changes to this bug.