From owner-svn-src-all@FreeBSD.ORG Tue Oct 25 16:30:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C0A11065688; Tue, 25 Oct 2011 16:30:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7CFE8FC1C; Tue, 25 Oct 2011 16:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9PGUGS3005294; Tue, 25 Oct 2011 16:30:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9PGUG0C005292; Tue, 25 Oct 2011 16:30:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201110251630.p9PGUG0C005292@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 25 Oct 2011 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226739 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2011 16:30:17 -0000 Author: nwhitehorn Date: Tue Oct 25 16:30:16 2011 New Revision: 226739 URL: http://svn.freebsd.org/changeset/base/226739 Log: Provide an error message instead of silent failure if no disks are present in the system. PR: bin/161950 MFC after: 3 days Modified: head/usr.sbin/bsdinstall/partedit/partedit.c Modified: head/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.c Tue Oct 25 16:22:43 2011 (r226738) +++ head/usr.sbin/bsdinstall/partedit/partedit.c Tue Oct 25 16:30:16 2011 (r226739) @@ -70,7 +70,7 @@ main(int argc, const char **argv) { struct partition_metadata *md; const char *prompt; - struct partedit_item *items; + struct partedit_item *items = NULL; struct gmesh mesh; int i, op, nitems, nscroll; int error; @@ -99,12 +99,21 @@ main(int argc, const char **argv) /* Show the part editor either immediately, or to confirm wizard */ while (1) { - error = geom_gettree(&mesh); - items = read_geom_mesh(&mesh, &nitems); - get_mount_points(items, nitems); dlg_clear(); dlg_put_backtitle(); + error = geom_gettree(&mesh); + if (error == 0) + items = read_geom_mesh(&mesh, &nitems); + if (error || items == NULL) { + dialog_msgbox("Error", "No disks found. If you need to " + "install a kernel driver, choose Shell at the " + "installation menu.", 0, 0, TRUE); + break; + } + + get_mount_points(items, nitems); + if (i >= nitems) i = nitems - 1; op = diskeditor_show("Partition Editor", prompt,