From 08b6360ca3462bcd825290754478c0071fa8d739 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 30 Nov 2008 23:46:31 +0000 Subject: Print error messages as-is, when they don't conform to [ 'value'] These are error messages from (lib)geom itself. --- sbin/geom/class/part/geom_part.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sbin/geom') diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index 7009cb97bc52..94b67da85838 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; -- cgit v1.2.3