Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
procps.8447
0044-top-avoid-a-nan-when-the-delay-interval-is...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0044-top-avoid-a-nan-when-the-delay-interval-is-very-low.patch of Package procps.8447
From fe37ad15cd394af021af7a3e5ad11bad70af4bfd Mon Sep 17 00:00:00 2001 From: Jim Warner <james.warner@comcast.net> Date: Sun, 27 Apr 2014 00:00:00 -0500 Subject: [PATCH] top: avoid a 'nan' when the delay interval is very low The granularity of /proc/uptime is fixed at hundredths of a second. And, since we can cycle faster than that, we are exposed to 'nan' when calculating elapsed time. This commit will protect us from that outcome when the delay interval has been set to an extremely low value. Signed-off-by: Jim Warner <james.warner@comcast.net> --- top/top.c | 1 + 1 file changed, 1 insertion(+) diff --git top/top.c top/top.c index 0428496..0ae5388 100644 --- top/top.c +++ top/top.c @@ -2525,6 +2525,7 @@ static void procs_hlp (proc_t *this) { uptime(&uptime_cur, NULL); et = uptime_cur - uptime_sav; + if (et < 0.01) et = 0.005; uptime_sav = uptime_cur; // if in Solaris mode, adjust our scaling for all cpus -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor