LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0662-Fix-specs-and-type-definitions-in-cpu_sup.patch of Package erlang (Project home:Ledest:erlang:20)

From 21e50952eb74625f5bf26d392c8945eae561267d Mon Sep 17 00:00:00 2001
From: Brujo Benavides <elbrujohalcon@gmail.com>
Date: Fri, 12 Apr 2019 09:32:47 -0300
Subject: [PATCH] Fix specs and type definitions in cpu_sup

Since `dummy_result/1` returns integers (i.e. `0`) not floats, `util/0,1` specs should account for that.
---
 lib/os_mon/src/cpu_sup.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/os_mon/src/cpu_sup.erl b/lib/os_mon/src/cpu_sup.erl
index ba2d89313e..d28f229b3e 100644
--- a/lib/os_mon/src/cpu_sup.erl
+++ b/lib/os_mon/src/cpu_sup.erl
@@ -68,7 +68,7 @@
 
 -type util_cpus() :: 'all' | integer() | [integer()].
 -type util_state() :: 'user' | 'nice_user' | 'kernel' | 'wait' | 'idle'.
--type util_value() :: [{util_state(), float()}] | float().
+-type util_value() :: [{util_state(), number()}] | number().
 -type util_desc() :: {util_cpus(), util_value(), util_value(), []}.
 
 %%----------------------------------------------------------------------
@@ -122,7 +122,7 @@ util(Args) when is_list (Args) ->
 util(_) ->
     erlang:error(badarg).
 
--spec util() -> float() | {'error', any()}.
+-spec util() -> number() | {'error', any()}.
 
 util() ->
     case util([]) of
-- 
2.16.4