/[autoconf]/autoconf/lib/Autom4te/XFile.pm
ViewVC logotype

Diff of /autoconf/lib/Autom4te/XFile.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by adl, Sat Sep 13 22:00:36 2003 UTC revision 1.9 by eggert, Tue Sep 30 19:29:48 2003 UTC
# Line 87  require 5.000; Line 87  require 5.000;
87  use strict;  use strict;
88  use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);  use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
89  use Carp;  use Carp;
90    use Errno;
91  use IO::File;  use IO::File;
92  use File::Basename;  use File::Basename;
93  use Autom4te::ChannelDefs;  use Autom4te::ChannelDefs;
# Line 216  sub lock Line 217  sub lock
217  {  {
218    my ($fh, $mode) = @_;    my ($fh, $mode) = @_;
219    # Cannot use @_ here.    # Cannot use @_ here.
220    if (!flock ($fh, $mode))  
221      # On some systems (e.g. GNU/Linux with NFSv2), flock(2) does not work over
222      # NFS, but Perl prefers that over fcntl(2) if it exists and if
223      # perl was not built with -Ud_flock.  Normally, this problem is harmless,
224      # so ignore the ENOLCK errors that are reported in that situation,
225      # However, if the invoker is using "make -j", the problem is not harmless,
226      # so report it in that case.  Admittedly this is a bit of a hack.
227      if (!flock ($fh, $mode)
228          && (!$!{ENOLCK} || " $ENV{'MAKEFLAGS'} " =~ / -j /))
229      {      {
230        my $file = $fh->name;        my $file = $fh->name;
231        fatal "cannot lock $file with mode $mode: $!";        fatal "cannot lock $file with mode $mode: $!";

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26