summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-11-30 23:46:31 +0000
committermarcel <marcel@FreeBSD.org>2008-11-30 23:46:31 +0000
commit5c813d4376f9af5c59729208974ee620e3091b10 (patch)
tree1517ec5e6ce46b7af089a2cc76b7c72efbb07b2c
parent875a18edd56204d8fe7279f385d4125c1bcb5e2c (diff)
downloadFreeBSD-src-5c813d4376f9af5c59729208974ee620e3091b10.zip
FreeBSD-src-5c813d4376f9af5c59729208974ee620e3091b10.tar.gz
Print error messages as-is, when they don't conform to
<errno> [<parameter> 'value'] These are error messages from (lib)geom itself.
-rw-r--r--sbin/geom/class/part/geom_part.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 7009cb9..94b67da 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -525,12 +525,15 @@ gpart_issue(struct gctl_req *req, unsigned int fl __unused)
}
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;
OpenPOWER on IntegriCloud