From owner-svn-src-all@FreeBSD.ORG Wed Sep 15 21:37:27 2010 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 2B206106566C; Wed, 15 Sep 2010 21:37:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A13D8FC14; Wed, 15 Sep 2010 21:37:27 +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 o8FLbQMO051735; Wed, 15 Sep 2010 21:37:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLbQqm051733; Wed, 15 Sep 2010 21:37:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009152137.o8FLbQqm051733@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 15 Sep 2010 21:37:26 +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: r212708 - head/sbin/geom/class/part 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: Wed, 15 Sep 2010 21:37:27 -0000 Author: pjd Date: Wed Sep 15 21:37:26 2010 New Revision: 212708 URL: http://svn.freebsd.org/changeset/base/212708 Log: GPART_PARAM_INDEX is now G_TYPE_NUMBER. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Wed Sep 15 21:19:54 2010 (r212707) +++ head/sbin/geom/class/part/geom_part.c Wed Sep 15 21:37:26 2010 (r212708) @@ -285,12 +285,10 @@ gpart_autofill_resize(struct gctl_req *r off_t last, size, start, new_size; off_t lba, new_lba; const char *s; - char *val; int error, idx; - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &val, 10); - if (idx < 1 || *s == '\0' || *val != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = geom_gettree(&mesh); @@ -775,7 +773,6 @@ gpart_bootcode(struct gctl_req *req, uns struct gclass *classp; struct ggeom *gp; const char *s; - char *sp; void *bootcode, *partcode; size_t bootsize, partsize; int error, idx, vtoc8; @@ -830,9 +827,8 @@ gpart_bootcode(struct gctl_req *req, uns if (gctl_has_param(req, GPART_PARAM_INDEX)) { if (partcode == NULL) errx(EXIT_FAILURE, "-i is only valid with -p"); - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &sp, 10); - if (idx < 1 || *s == '\0' || *sp != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = gctl_delete_param(req, GPART_PARAM_INDEX); if (error)