summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CuTmpdir.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/CuTmpdir.pm b/tests/CuTmpdir.pm
index f8d43d5ff..38bc7245e 100644
--- a/tests/CuTmpdir.pm
+++ b/tests/CuTmpdir.pm
@@ -64,11 +64,14 @@ sub wanted
END {
my $saved_errno = $?;
- chdir $dir
- or warn "$ME: failed to chdir to $dir: $!\n";
- # Perform the equivalent of find . -type d -print0|xargs -0 chmod -R 700.
- my $options = {untaint => 1, wanted => \&wanted};
- find ($options, '.');
+ if (defined $dir)
+ {
+ chdir $dir
+ or warn "$ME: failed to chdir to $dir: $!\n";
+ # Perform the equivalent of find . -type d -print0|xargs -0 chmod -R 700.
+ my $options = {untaint => 1, wanted => \&wanted};
+ find ($options, '.');
+ }
$? = $saved_errno;
}