* tests/CuTmpdir.pm (chmod_tree): Don't chmod if chdir failed.
Signed-off-by: Bo Borgerson <gigabo@gmail.com>
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 {