summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/CuTmpdir.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/CuTmpdir.pm b/tests/CuTmpdir.pm
index 84312a039..e21306a57 100644
--- a/tests/CuTmpdir.pm
+++ b/tests/CuTmpdir.pm
@@ -45,11 +45,16 @@ sub chmod_1
sub chmod_tree
{
- 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 => \&chmod_1};
- find ($options, '.');
+ if (chdir $dir)
+ {
+ # Perform the equivalent of find . -type d -print0|xargs -0 chmod -R 700.
+ my $options = {untaint => 1, wanted => \&chmod_1};
+ find ($options, '.');
+ }
+ else
+ {
+ warn "$ME: failed to chdir to $dir: $!\n";
+ }
}
sub import {