[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoconf 2.57b: locking fails over NFS
From: |
Akim Demaille |
Subject: |
Re: autoconf 2.57b: locking fails over NFS |
Date: |
Wed, 01 Oct 2003 09:17:05 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
> OK, I installed this patch. I can't test it easily, though.
> (For one thing, CVS autoconf doesn't build itself on my host,
> since it depends on an alpha version of autoconf....)
Does it? Where?
> 2003-09-30 Paul Eggert <address@hidden>
> * lib/Autom4te/XFile.pm: Use Errno.
> (lock): Ignore ENOLCK errors. Problem reported Andreas Schwab in
> <http://mail.gnu.org/archive/html/bug-autoconf/2003-09/msg00141.html>.
> Index: XFile.pm
> ===================================================================
> RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/XFile.pm,v
> retrieving revision 1.8
> retrieving revision 1.10
> diff -p -u -r1.8 -r1.10
> --- XFile.pm 13 Sep 2003 22:00:36 -0000 1.8
> +++ XFile.pm 30 Sep 2003 19:34:28 -0000 1.10
> @@ -87,6 +87,7 @@ require 5.000;
> use strict;
> use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
> use Carp;
> +use Errno;
> use IO::File;
> use File::Basename;
> use Autom4te::ChannelDefs;
> @@ -216,7 +217,15 @@ sub lock
> {
> my ($fh, $mode) = @_;
> # Cannot use @_ here.
> - if (!flock ($fh, $mode))
> +
> + # On some systems (e.g. GNU/Linux with NFSv2), flock(2) does not work over
> + # NFS, but Perl prefers that over fcntl(2) if it exists and if
> + # perl was not built with -Ud_flock. Normally, this problem is harmless,
> + # so ignore the ENOLCK errors that are reported in that situation,
> + # However, if the invoker is using "make -j", the problem is not harmless,
> + # so report it in that case. Admittedly this is a bit of a hack.
> + if (!flock ($fh, $mode)
> + && (!$!{ENOLCK} || " $ENV{'MAKEFLAGS'}" =~ / (-j|--jobs)/))
> {
> my $file = $fh->name;
> fatal "cannot lock $file with mode $mode: $!";
I installed this in Automake, where it belongs.
- Re: autoconf 2.57b: locking fails over NFS,
Akim Demaille <=