From owner-svn-src-head@FreeBSD.ORG Tue Jul 9 21:20:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2C4D336; Tue, 9 Jul 2013 21:20:08 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B038E1D61; Tue, 9 Jul 2013 21:20:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LK8mQ045463; Tue, 9 Jul 2013 21:20:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LK8br045462; Tue, 9 Jul 2013 21:20:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307092120.r69LK8br045462@svn.freebsd.org> From: Jim Harris Date: Tue, 9 Jul 2013 21:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253110 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 21:20:08 -0000 Author: jimharris Date: Tue Jul 9 21:20:08 2013 New Revision: 253110 URL: http://svnweb.freebsd.org/changeset/base/253110 Log: 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. Sponsored by: Intel MFC after: 3 days Modified: head/sbin/nvmecontrol/firmware.c Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Tue Jul 9 21:14:15 2013 (r253109) +++ head/sbin/nvmecontrol/firmware.c Tue Jul 9 21:20:08 2013 (r253110) @@ -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,