aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-03-19 11:08:56 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-19 11:08:56 +0100
commit8eee9c1d692a5c9cfebe3ddda1f84ecc529bf7f2 (patch)
tree8ceedd58ddf56ecc2fbaceea8d85354a958fdc88
parente4b5f63f6ba9ab7548c9cd3b93351d0120fd358f (diff)
parente36017157ee5d8d7f50a769a2ecfce4ece1eea64 (diff)
downloadotp-8eee9c1d692a5c9cfebe3ddda1f84ecc529bf7f2.tar.gz
otp-8eee9c1d692a5c9cfebe3ddda1f84ecc529bf7f2.tar.bz2
otp-8eee9c1d692a5c9cfebe3ddda1f84ecc529bf7f2.zip
Merge branch 'kovyl2404/maint/cpu_sup_big_loadavg/OTP-12581' into maint
* kovyl2404/maint/cpu_sup_big_loadavg/OTP-12581: Handle big loadavg values correctly
-rw-r--r--lib/os_mon/src/cpu_sup.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/os_mon/src/cpu_sup.erl b/lib/os_mon/src/cpu_sup.erl
index 1f088ecbde..66e7973e7e 100644
--- a/lib/os_mon/src/cpu_sup.erl
+++ b/lib/os_mon/src/cpu_sup.erl
@@ -221,7 +221,7 @@ get_uint32_measurement(Request, #internal{port = P, os_type = {unix, sunos}}) ->
port_server_call(P, Request);
get_uint32_measurement(Request, #internal{os_type = {unix, linux}}) ->
{ok,F} = file:open("/proc/loadavg",[read,raw]),
- {ok,D} = file:read(F,24),
+ {ok,D} = file:read_line(F),
ok = file:close(F),
{ok,[Load1,Load5,Load15,_PRun,PTotal],_} = io_lib:fread("~f ~f ~f ~d/~d", D),
case Request of