Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2013 22:13:46 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r253299 - stable/9/sbin/nvmecontrol
Message-ID:  <201307122213.r6CMDknq068967@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jimharris
Date: Fri Jul 12 22:13:46 2013
New Revision: 253299
URL: http://svnweb.freebsd.org/changeset/base/253299

Log:
  MFC r253110:
  
    Try to read firmware image before prompting the user to confirm
    firmware download.  This correctly prints an error and exits for
    an incorrect firmware image name before prompting the user to
    confirm the download.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/firmware.c
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/firmware.c
==============================================================================
--- stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:12:48 2013	(r253298)
+++ stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:13:46 2013	(r253299)
@@ -253,6 +253,9 @@ firmware(int argc, char *argv[])
 		    "of available images\n",
 		    slot, controller);
 
+	if (f_flag)
+		read_image_file(image, &buf, &size);
+
 	if (f_flag && a_flag)
 		printf("You are about to download and activate "
 		       "firmware image (%s) to controller %s.\n"
@@ -282,7 +285,6 @@ firmware(int argc, char *argv[])
 	}
 
 	if (f_flag) {
-		read_image_file(image, &buf, &size);
 		update_firmware(fd, buf, size);
 		if (a_flag)
 			activate_firmware(fd, slot,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307122213.r6CMDknq068967>