svn commit: r219263 - stable/8/usr.sbin/mfiutil

Sergey Kandaurov pluknet at FreeBSD.org
Fri Mar 4 12:18:51 UTC 2011


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;


More information about the svn-src-all mailing list