Skip to content

Commit

Permalink
[backend] fix warnings in 0015-BSSched-EventSource-Directory.t
Browse files Browse the repository at this point in the history
without this patch you get warnings like this:

t/data/0015/events/x86_64/unblocked::devel:languages:perl::openSUSE_Leap_42.1: No such file or directory at t/0015-BSSched-EventSource-Directory.t line 264.

after successful completion of all jobs.
This is missleading because $! is _not_ reset and not meant to detect an error.
  • Loading branch information
M0ses committed Jan 20, 2021
1 parent 874bb00 commit a5c49a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/backend/t/0015-BSSched-EventSource-Directory.t
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ push(@files_to_remove,"$ev_dir/$file_name");
unshift(@files_to_remove,"$eventdir_base/$arch/$evname");

for (BSUtil::unify(sort {$b cmp $a} @files_to_remove)) {
( -d $_ ) ? rmdir $_ : unlink $_;
warn "$_: $!" if $!;
if ( -d $_ ) {
rmdir $_ || warn "$_: $!"
} else {
unlink $_ || warn "$_: $!";
}
}

exit 0;
Expand Down

0 comments on commit a5c49a5

Please sign in to comment.