Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Nov 2008 23:46:31 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185496 - head/sbin/geom/class/part
Message-ID:  <200811302346.mAUNkVnt005749@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Nov 30 23:46:31 2008
New Revision: 185496
URL: http://svn.freebsd.org/changeset/base/185496

Log:
  Print error messages as-is, when they don't conform to
  	<errno> [<parameter> 'value']
  These are error messages from (lib)geom itself.

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	Sun Nov 30 23:38:44 2008	(r185495)
+++ head/sbin/geom/class/part/geom_part.c	Sun Nov 30 23:46:31 2008	(r185496)
@@ -525,12 +525,15 @@ gpart_issue(struct gctl_req *req, unsign
 	}
 
 	error = strtol(errstr, &errmsg, 0);
-	while (errmsg[0] == ' ')
-		errmsg++;
-	if (errmsg[0] != '\0')
-		warnc(error, "%s", errmsg);
-	else
-		warnc(error, NULL);
+	if (errmsg != errstr) {
+		while (errmsg[0] == ' ')
+			errmsg++;
+		if (errmsg[0] != '\0')
+			warnc(error, "%s", errmsg);
+		else
+			warnc(error, NULL);
+	} else
+		warnx("%s", errmsg);
 
 	status = EXIT_FAILURE;
 



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