develooper Front page | perl.perl5.porters | Postings from June 2008

[rt.cpan.org #29606] HP-UX 11.11: Your OS does not support locking

From:
R. U. M. Burak via RT
Date:
June 29, 2008 10:58
Subject:
[rt.cpan.org #29606] HP-UX 11.11: Your OS does not support locking
Message ID:
rt-3.6.HEAD-8135-1214757991-179.29606-5-0@rt.cpan.org
       Queue: CPAN
 Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29606 >

On Di. 25. Sep. 2007, 17:13:52, andreas.koenig.7os6VVqR@franz.ak.mind.de
wrote:
> >>>>> On Tue, 25 Sep 2007 14:43:37 -0400, "Steve Cooper via RT" <bug-
> CPAN@rt.cpan.org> said:
> 
>   > I updated yesterday from CPAN 1.9102 to 1.92 and now get the
> following
>   > line frequently when I run CPAN:
> 
>   > Your OS does not support locking; continuing and ignoring all
> locking
>   > issues
> 
>   > Everything appears to run just fine, though.
> 
> Only few operations of CPAN.pm need locking: running parallel shells
> and running from parallel batch jobs and such.
> 
>   > How do I make that error go away?
> 
> The next version will have something like this patch that will
> guarantee that the warning is only issued once:
> 
> Index: lib/CPAN.pm
> ===================================================================
> --- lib/CPAN.pm	(revision 2270)
> +++ lib/CPAN.pm	(working copy)
> @@ -386,10 +386,12 @@
>      my($fh,$mode) = @_;
>      if ($Config::Config{d_flock}) {
>          return flock $fh, $mode;
> -    } else {
> +    } elsif (!$Have_warned->{"d_flock"}++) {
>          $CPAN::Frontend->mywarn("Your OS does not support locking;
> continuing and ignoring all locking issues\n");
>          $CPAN::Frontend->mysleep(5);
>          return 1;
> +    } else {
> +        return 1;
>      }
>  }
> 
> 
> 
> 
> Thanks for your report!


Just some info from my side:
On Solaris 10 (without having installed the ucb 'compatible' libs (=
including 'flock') I have the same 'problem' as the original poster! (I
see the warning 'Your OS does not support locking' once! (Using CPAN.pm
1.9205)

This happens, because the test 'if ($Config::Config{d_flock}) {' is wrong!
My CPAN.pm includes 'Fcntl qw(:flock)' so 'fcntl' is 'emulating' the
'flock'! So the correct test should be something like this:

if ((!$Config{'d_flock'} || $Config{'d_flock'} ne 'define') &&
    (!$Config{'d_fcntl_can_lock'} || $Config{'d_fcntl_can_lock'} ne
'define')) {

then 'flock' will be called, and I don't see the the curious
error/warning message! It would be nice to see that small fix in the
next version of CPAN.pm.....







nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About