summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-09-01 15:11:12 +0200
committerJim Meyering <meyering@redhat.com>2011-09-01 16:36:23 +0200
commit551cbda0278d7e88c7ba52be0510f42ad2466e48 (patch)
treecfe42a4e7f93e773d3f5927e2a800c9bd0cc92d6 /tests
parentaf5f2d741b8e50e629b3e025631c09e9b6ccf49e (diff)
downloadcoreutils-551cbda0278d7e88c7ba52be0510f42ad2466e48.tar.xz
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.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/pwd-long2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/misc/pwd-long b/tests/misc/pwd-long
index 3a5147d76..e31845796 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;
}