File obs-server-2.10-0013-backend-Fix-cleanup-in-BSSched-EventSource-Directory.patch of Package obs-server

From 855b803b86941d4636b6c7cf779165373ed69323 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Wed, 29 Jun 2016 20:00:40 +0100
Subject: [PATCH] [backend] Fix cleanup in BSSched::EventSource::Directory
 test.

The $! (errno) variable is not assigned to zero upon successful
system call.

This means that value of $! should not be used to check whether
rmdir() or unlink() succeeded; return value should be checked instead.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/backend/t/0015-BSSched-EventSource-Directory.t | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/t/0015-BSSched-EventSource-Directory.t b/src/backend/t/0015-BSSched-EventSource-Directory.t
index 5274935981..f7138b4a01 100644
--- a/src/backend/t/0015-BSSched-EventSource-Directory.t
+++ b/src/backend/t/0015-BSSched-EventSource-Directory.t
@@ -258,8 +258,7 @@ 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 $!;
+  ( -d $_ ) ? rmdir $_ : unlink $_ or warn "$_: $!" if $!;
 }
 
 exit 0;
-- 
2.31.1