From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 4 12:20:14 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A4BC106564A; Fri, 4 Mar 2011 12:20:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 888508FC17; Fri, 4 Mar 2011 12:20:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24CKExW031303; Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24CKEM6031301; Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201103041220.p24CKEM6031301@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 4 Mar 2011 12:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219264 - stable/7/usr.sbin/mfiutil X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2011 12:20:14 -0000 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;