Test suite: Improve error handling for non-existant log files

This commit is contained in:
Jonathan Bennett 2016-05-17 09:12:11 -05:00
parent 8334473887
commit f8273783da

View File

@ -8179,12 +8179,14 @@ sub file_find_regex() {
return 0 if $tries == 5;
}
open RE, "< $file" or
(&write_test_file("[-] Could not open $file: $!\n", $curr_test_file) and return 0);
if (open (RE, "<", $file)) {
while (<RE>) {
push @file_lines, $_;
}
close RE;
} else {
&write_test_file("[-] Could not open $file: $!\n", $curr_test_file) and return 0;
}
for my $re (@$re_ar) {
my $matched = 0;