From: Alexandre Duret-Lutz Date: Mon, 1 Nov 2004 17:35:36 +0000 (+0000) Subject: * lib/Automake/XFile.pm (lock): Make sure $ENV{'MAKEFLAGS'} exists X-Git-Tag: Release-1-9b~268 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=ea3dc28d1d299bc48538be7c9bb1f1a823fa4db6;p=automake.git * lib/Automake/XFile.pm (lock): Make sure $ENV{'MAKEFLAGS'} exists before inspecting it; this fixes "uninitialized value in concatenation" diagnostics when flock fails. Report from Gary V. Vaughan. --- diff --git a/ChangeLog b/ChangeLog index 09419408..92350ef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-11-01 Alexandre Duret-Lutz + * lib/Automake/XFile.pm (lock): Make sure $ENV{'MAKEFLAGS'} exists + before inspecting it; this fixes "uninitialized value in + concatenation" diagnostics when flock fails. + Report from Gary V. Vaughan. + * aclocal.in: Use strict and -w. Declare local variables with `my', and get rid of `local'. (scan_m4_files, add_macro): Reindent these functions while we are diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm index 279317b7..dc39ffeb 100644 --- a/lib/Automake/XFile.pm +++ b/lib/Automake/XFile.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -228,10 +228,12 @@ sub lock # Admittedly this is a bit of a hack. if (!flock ($fh, $mode) && (!$!{ENOLCK} - || " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*j|---?jobs)/)) + || (exists $ENV{'MAKEFLAGS'} + && " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*j|---?jobs)/))) { my $file = $fh->name; - fatal "cannot lock $file with mode $mode (perhaps you are running make -j on a lame NFS client?): $!"; + fatal ("cannot lock $file with mode $mode " + . "(perhaps you are running make -j on a lame NFS client?): $!"); } }