"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Automake/XFile.pm" between
automake-1.16.2.tar.xz and automake-1.16.3.tar.xz

About: GNU Automake is a Makefile generator (input Makefile.am, output Makefile.in; intended for use with autoconf).

XFile.pm  (automake-1.16.2.tar.xz):XFile.pm  (automake-1.16.3.tar.xz)
skipping to change at line 74 skipping to change at line 74
C<Automake::XFile> inherits from C<IO::File>. It provides the method C<Automake::XFile> inherits from C<IO::File>. It provides the method
C<name> returning the file name. It provides dying versions of the C<name> returning the file name. It provides dying versions of the
methods C<close>, C<lock> (corresponding to C<flock>), C<new>, methods C<close>, C<lock> (corresponding to C<flock>), C<new>,
C<open>, C<seek>, and C<truncate>. It also overrides the C<getline> C<open>, C<seek>, and C<truncate>. It also overrides the C<getline>
and C<getlines> methods to translate C<\r\n> to C<\n>. and C<getlines> methods to translate C<\r\n> to C<\n>.
=cut =cut
use 5.006; use 5.006;
use strict; use strict;
use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA); use warnings FATAL => 'all';
use Carp;
use Errno; use Errno;
use Exporter;
use IO::File; use IO::File;
use File::Basename;
use Automake::ChannelDefs; use Automake::ChannelDefs;
use Automake::Channels qw(msg); use Automake::Channels qw (msg);
use Automake::FileUtils; use Automake::FileUtils;
require Exporter; our @ISA = qw(Exporter IO::File);
require DynaLoader; our @EXPORT = @IO::File::EXPORT;
our $VERSION = "1.2";
@ISA = qw(IO::File Exporter DynaLoader);
$VERSION = "1.2";
@EXPORT = @IO::File::EXPORT;
eval { eval {
# Make all Fcntl O_XXX and LOCK_XXX constants available for importing # Make all Fcntl O_XXX and LOCK_XXX constants available for importing
require Fcntl; require Fcntl;
my @O = grep /^(LOCK|O)_/, @Fcntl::EXPORT, @Fcntl::EXPORT_OK; my @O = grep /^(LOCK|O)_/, @Fcntl::EXPORT, @Fcntl::EXPORT_OK;
Fcntl->import (@O); # first we import what we want to export Fcntl->import (@O); # first we import what we want to export
push (@EXPORT, @O); push (@EXPORT, @O);
}; };
=head2 Methods =head2 Methods
skipping to change at line 235 skipping to change at line 231
=cut =cut
sub lock sub lock
{ {
my ($fh, $mode) = @_; my ($fh, $mode) = @_;
# Cannot use @_ here. # Cannot use @_ here.
# Unless explicitly configured otherwise, Perl implements its 'flock' with the # Unless explicitly configured otherwise, Perl implements its 'flock' with the
# first of flock(2), fcntl(2), or lockf(3) that works. These can fail on # first of flock(2), fcntl(2), or lockf(3) that works. These can fail on
# NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD); we # NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD) or
# EINVAL (OpenIndiana, as per POSIX 1003.1-2017 fcntl spec); we
# usually ignore these errors. If $ENV{MAKEFLAGS} suggests that a parallel # usually ignore these errors. If $ENV{MAKEFLAGS} suggests that a parallel
# invocation of 'make' has invoked the tool we serve, report all locking # invocation of 'make' has invoked the tool we serve, report all locking
# failures and abort. # failures and abort.
# #
# On Unicos, flock(2) and fcntl(2) over NFS hang indefinitely when 'lockd' is # On Unicos, flock(2) and fcntl(2) over NFS hang indefinitely when 'lockd' is
# not running. NetBSD NFS clients silently grant all locks. We do not # not running. NetBSD NFS clients silently grant all locks. We do not
# attempt to defend against these dangers. # attempt to defend against these dangers.
# #
# -j is for parallel BSD make, -P is for parallel HP-UX make. # -j is for parallel BSD make, -P is for parallel HP-UX make.
if (!flock ($fh, $mode)) if (!flock ($fh, $mode))
{ {
my $make_j = (exists $ENV{'MAKEFLAGS'} my $make_j = (exists $ENV{'MAKEFLAGS'}
&& " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*[jP]|--[jP]|---? jobs)/); && " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*[jP]|--[jP]|---? jobs)/);
my $note = "\nforgo \"make -j\" or use a file system that supports locks"; my $note = "\nforgo \"make -j\" or use a file system that supports locks";
my $file = $fh->name; my $file = $fh->name;
msg ($make_j ? 'fatal' : 'unsupported', msg ($make_j ? 'fatal' : 'unsupported',
"cannot lock $file with mode $mode: $!" . ($make_j ? $note : "")) "cannot lock $file with mode $mode: $!" . ($make_j ? $note : ""))
if $make_j || !($!{ENOLCK} || $!{EOPNOTSUPP}); if $make_j || !($!{EINVAL} || $!{ENOLCK} || $!{EOPNOTSUPP});
} }
} }
=item C<$fh-E<gt>seek ($position, [$whence])> =item C<$fh-E<gt>seek ($position, [$whence])>
Seek file to C<$position>. Die if seeking fails. Seek file to C<$position>. Die if seeking fails.
=cut =cut
sub seek sub seek
 End of changes. 7 change blocks. 
14 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)