From: Craig Small Date: Tue, 30 Oct 2012 10:48:34 +0000 (+1100) Subject: Stop SIGFPE on vmstat at times X-Git-Tag: v3.3.5^0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64fa889816ba496e1c0ce66d7c2e1e93300f9ec1;p=procps-ng Stop SIGFPE on vmstat at times Certain setups can crash vmstat with a SIGFPE, this small patch catches those events Bug-Debian: http://bugs.debian.org/677903 --- diff --git a/vmstat.c b/vmstat.c index 93f620d1..c1337662 100644 --- a/vmstat.c +++ b/vmstat.c @@ -258,6 +258,7 @@ static void new_format(void) diow = *cpu_iow; dstl = *cpu_zzz; Div = duse + dsys + didl + diow + dstl; + if (!Div) Div = 1, didl = 1; divo2 = Div / 2UL; printf(format, running, blocked, @@ -312,6 +313,7 @@ static void new_format(void) } Div = duse + dsys + didl + diow + dstl; + if (!Div) Div = 1, didl = 1; divo2 = Div / 2UL; printf(format, running,