From c51c256c93204289e94cfc06fd86e1dd4a5b2074 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 1 Nov 2004 17:35:37 +0000 Subject: [PATCH] * 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. --- ChangeLog | 5 +++++ lib/Automake/XFile.pm | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0941940..92350ef 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 279317b..dc39ffe 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?): $!"); } } -- 2.7.4