Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 2010 21:37:26 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212708 - head/sbin/geom/class/part
Message-ID:  <201009152137.o8FLbQqm051733@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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