File 1458-os_mon-Fix-disksup-full-threshold-testcase.patch of Package erlang

From 1c28043ce0352e82394be045f0653714d963dbd9 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Wed, 21 Sep 2022 12:49:21 +0200
Subject: [PATCH 2/5] os_mon: Fix disksup full threshold testcase

On systems with 0% of used disk space this testcase used to
fail. Note that 0% does not mean that 9 bytes was used, just
that the df command rounded down to 0% usage.
---
 lib/os_mon/test/disksup_SUITE.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 1775456514..a583c1e4d7 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -332,8 +332,8 @@ otp_5910(Config) when is_list(Config) ->
 		     0 ->
 			 [{_Id,_Kbyte,Cap}|_] = Data,
 			 io:format("Data ~p Threshold ~p ~n",[Data, Cap-1]),
-			 ok = disksup:set_almost_full_threshold((Cap-1)/100),
-			 Cap-1;
+			 ok = disksup:set_almost_full_threshold((max(0, Cap-1))/100),
+			 max(0, Cap-1);
 		     _N -> Threshold0
 		 end,
     ok = application:set_env(os_mon, disk_almost_full_threshold, Threshold/100),
-- 
2.35.3

openSUSE Build Service is sponsored by