Date: Fri, 4 Mar 2011 12:18:51 +0000 (UTC) From: Sergey Kandaurov <pluknet@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r219263 - stable/8/usr.sbin/mfiutil Message-ID: <201103041218.p24CIpJ3031212@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pluknet Date: Fri Mar 4 12:18:50 2011 New Revision: 219263 URL: http://svn.freebsd.org/changeset/base/219263 Log: MFC r219031: Fix division by zero, causing floating point exception in a drive progress command. Approved by: avg (mentor), kib (mentor) Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_cmd.c Fri Mar 4 12:02:32 2011 (r219262) +++ stable/8/usr.sbin/mfiutil/mfi_cmd.c Fri Mar 4 12:18:50 2011 (r219263) @@ -316,7 +316,7 @@ mfi_display_progress(const char *label, printf("%s: %.2f%% complete, after %ds", label, (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds); - if (prog->elapsed_seconds > 10) { + if (prog->progress != 0 && prog->elapsed_seconds > 10) { printf(" finished in "); seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) / prog->progress - prog->elapsed_seconds;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103041218.p24CIpJ3031212>