From 5eb1ad14622fea8d1b491d83ce96a7df74875c29 Mon Sep 17 00:00:00 2001 From: lulf Date: Tue, 30 Sep 2008 07:18:49 +0000 Subject: - Improve error message given on g_providername call failure. - While there, make error messages consistent with the rest. Approved by: kib (mentor) --- sbin/bsdlabel/bsdlabel.c | 2 +- sbin/fdisk/fdisk.c | 2 +- usr.sbin/boot0cfg/boot0cfg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index d3ec899..97ddeb6 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -238,7 +238,7 @@ main(int argc, char *argv[]) pname = g_providername(fd); close(fd); if (pname == NULL) { - warnx("error getting providername for %s", specname); + warn("error getting providername for %s", specname); return(1); } } diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index e540038..90b3403 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -770,7 +770,7 @@ write_disk(off_t sector, void *buf) gctl_ro_param(grq, "class", -1, "MBR"); pname = g_providername(fd); if (pname == NULL) { - warnx("Error getting providername for %s\n", disk); + warn("Error getting providername for %s", disk); return (-1); } gctl_ro_param(grq, "geom", -1, pname); diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c index 63fa78e..6f10308 100644 --- a/usr.sbin/boot0cfg/boot0cfg.c +++ b/usr.sbin/boot0cfg/boot0cfg.c @@ -274,12 +274,12 @@ write_mbr(const char *fname, int flags, u_int8_t *mbr, int mbr_size) /* Try open it read only. */ fd = open(fname, O_RDONLY); if (fd == -1) { - warnx("Error opening %s\n", fname); + warn("error opening %s", fname); return; } pname = g_providername(fd); if (pname == NULL) { - warnx("Error getting providername for %s\n", fname); + warn("error getting providername for %s", fname); return; } if (flags != 0) -- cgit v1.1