Date: Fri, 4 Mar 2011 12:20:14 +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-7@freebsd.org Subject: svn commit: r219264 - stable/7/usr.sbin/mfiutil Message-ID: <201103041220.p24CKEM6031301@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pluknet Date: Fri Mar 4 12:20:14 2011 New Revision: 219264 URL: http://svn.freebsd.org/changeset/base/219264 Log: MFC r219031: Fix division by zero, causing floating point exception in a drive progress command. Approved by: avg (mentor), kib (mentor) Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c Directory Properties: stable/7/usr.sbin/mfiutil/ (props changed) Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_cmd.c Fri Mar 4 12:18:50 2011 (r219263) +++ stable/7/usr.sbin/mfiutil/mfi_cmd.c Fri Mar 4 12:20:14 2011 (r219264) @@ -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?201103041220.p24CKEM6031301>