From: Jim Meyering Date: Thu, 1 Sep 2011 13:11:12 +0000 (+0200) Subject: tests: pwd-long: diagnose failure earlier X-Git-Tag: v8.13~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=551cbda0278d7e88c7ba52be0510f42ad2466e48;p=thirdparty%2Fcoreutils.git tests: pwd-long: diagnose failure earlier Without this change, we'd get use-of-uninit value warnings and harder-to-diagnose failure down the road. * tests/misc/pwd-long (normalize_to_cwd_relative): Diagnose stat failure. This failed on AIX 6.1 and 7.1. Reported by Bruno Haible. --- diff --git a/tests/misc/pwd-long b/tests/misc/pwd-long index 3a5147d762..e318457963 100755 --- a/tests/misc/pwd-long +++ b/tests/misc/pwd-long @@ -50,6 +50,8 @@ sub normalize_to_cwd_relative ($$$) and die "$ME: $dir does not contain old CWD\n"; my $dir_prefix = $slash ? substr ($dir, 0, $slash) : '/'; my ($d, $i) = (stat $dir_prefix)[0, 1]; + defined $d && defined $i + or die "$ME: $dir_prefix: stat failed: $!\n"; $d eq $dev && $i eq $ino and return substr $dir, $slash + 1; }